Mail Archives: djgpp/1999/07/28/07:39:20
From: | sam AT greenaumARSE!ARSE!ARSE!.demon.co.uk
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: Terminal Programming
|
Date: | Wed, 28 Jul 1999 00:10:10 GMT
|
Organization: | Rossum's Universal Robots
|
Message-ID: | <37a448d2.3428616@news.demon.co.uk>
|
References: | <3798FE1B DOT AE7EEEC AT mindspring DOT com>
|
NNTP-Posting-Host: | greenaum.demon.co.uk
|
X-NNTP-Posting-Host: | greenaum.demon.co.uk:194.222.71.189
|
X-Trace: | news.demon.co.uk 933120506 nnrp-14:6801 NO-IDENT greenaum.demon.co.uk:194.222.71.189
|
X-Complaints-To: | abuse AT demon DOT net
|
X-Newsreader: | Forte Agent 1.5/32.452
|
X-No-Archive: | yes
|
MIME-Version: | 1.0
|
Lines: | 36
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
You want ideas? Have an array of strings with your function names in
it, so you can compare them in turn, to give a number for the command.
Then you could possibly have a table of function pointers, if you
wanted.
Have a proper parser that splits your input into the first command,
and parameters (ie $0, $1, $2 etc). To avoid having to use a
variable-length array, or a list or something, only parse the first
ten words in an input, and keep the rest of the line up til <cr> as
just one string. Unix shell does it this way, $0 to $9 then $@ for the
rest.
Make the parser flexible so you can use it in different routines.
Write some other general-purpose routines.
Give it a programming language so you can write batch files.
The for(;;) is obviously bad, invent some sort of nice clean exit
condition.
Some people have written things like this as replacement shells for
Unix, you could perhaps invent your own command-line alternative to
MS-DOS for file maintenance and things. One thing (just one) that DOS
sucks at, is wildcards and regular expressions, do something about
that.
If you get a useful core up and running, you'll be adding things to it
and it'll grow up in no time. What do you mostly use DOS for?
------------------------------------------------------------------------
Is it wrong to want to live on your own ?
No, it's not wrong in your own home!
http://www.greenaum.demon.co.uk/
- Raw text -