home *** CD-ROM | disk | FTP | other *** search
- | file DEMO.MSH Introduction to Mi-Shell, a tutorial
- "Welcome to MSH"
- " Copyright(C) PMC/OPENetwork 1989-1991 Author: Jean MICHEL "
- message | the message command needs 2 arguments.
- ("Demo" swap message)m! | here we define m on the fly which will need only 1.
- " MSH is a DOS \"shell\" which provides a convenient and CONFIGURABLE way
- to browse through directories and execute commands on files and sets of
- files by a `point and shoot' interface."m
- " This demonstration has been designed to perform best if you
- start it in a directory which contains a lot of files and is not
- your root directory. The directory where you keep your MSH files, if
- you have one, is a good candidate. If you are not there, we'll take
- you there. Of course, you can always abort from MSH by pressing CtrlC,
- and answering Yes."m
- prog_dir cwd! refresh Tab prog_dir cwd! refresh Tab
- " You can move up and down panels with Up and Down keys on your
- numeric pad. We go down one file. . . "m
- Down
- " another . . . "
- m Down
- " yet another . . . "
- m Down
- " then up . . . "
- m Up
- " You can go down one screen with the PgDn key. . . "
- m PgDn
- " And back up one screen with PgUp. . . "
- m PgUp
- " Let's look at the ways we may sort the panels.
- By default, they are sorted alphabetically. Let's
- sort the current panel by size by pressing AltS. . . "
- m AltS
- " Notice that the title 'size' at the bottom of the panel became
- highlighted. Let's sort now by extension (pressing AltE)
- and notice what happens to the highlighted titles at the bottom of the
- panel. . . "
- m AltE
- " `ext' is now highlighted, but `size' too: this reflects the
- fact that we kept the last sort (by size) as a secondary sort.
- We have to do AltN to sort again alphabetically. . . "
- m AltN
- " You can expand the current panel with the CtrlE key . . . "
- m CtrlE
- " And trim it with the CtrlT key . . . "
- m CtrlT
- " Let's trim it again . . . "
- m CtrlT
- " You can go to the other panel with the Tab key. . . "
- m Tab
- " You can even swap the panels with CtrlU. . . "
- m CtrlU
- " And switch them off with CtrlO. . . "
- m CtrlO
- " Oops! we don't want to do that yet. . .
- Before we return with CtrlO, do notice
- the little magic indicator window on the
- top right. This shows if swapping is on and lets
- you change its type (to disk or XMS) by clicking
- on this window. It also reminds you that Mi-Shell is active
- (Magic is explained in the other tutorial)."
- m CtrlO
- cmd.clear "Hello! I am the command line" cmd!
- " All this may be mildly interesting, but to really DO something,
- we must execute commands. Let's look at the command line."
- m
- " Let us clear the command line by pressing Esc "
- m cmd.clear
- " You may use the command line to execute commands, of course. . . "
- m cmd.clear "DIR" dup cmd! execsave
- " You have better facilities to edit this line than DOS provides.
- Look at the command line. . . "
- m cmd.clear "Hello! I am the command line" cmd!
- " We press Home to go to its beginning. . . "
- m Home
- " Notice this did not destroy its content. We go a couple characters
- Right by pressing Right twice. . . "
- m Right Right
- " Then go in insert mode by pressing Insert. . . "
- m Insert
- " You may notice that the cursor shape has changed. Let us
- write a couple characters, then go back to replace mode
- by pressing Insert again. . . "
- m "ZZ" cmd! Insert
- " go two words right by pressing CtrlRight twice. . . "
- m CtrlRight CtrlRight
- " then write again 4 characters. . . ."
- m "AAAA" cmd!
- " With the CtrlHome key,
- you may even recall previous commands in order to edit one . . ."
- m CtrlHome " " cmd!
- " There are other ways to use MSH's facilities to do things more
- conveniently. For instance, you may press CtrlJ to write to the
- command line the name of the file currently pointed to in the panel. . . "
- m CtrlJ
- " If you have several file names to write, it's a good time to start
- using the facilities of MSH to select groups of files. Let's go down
- one file with the Down key and SELECT it by pressing F2. . . "
- m Down F2
- " Let's go down a couple of files. . . "
- m Down Down
- " And select another one. . . "
- m F2
- " And write both files' names to the command line by pressing CtrlA "
- m CtrlA
- " There are more efficient ways to select files. To select all files
- with an extension of exe, write `*.exe' on the command line. . . "
- m cmd.clear "*.exe" cmd!
- " Then press GreyPlus. . . "
- m GreyPlus
- " Actually, if you are only interested in `.exe' files, you may discard all
- the other ones from your panel. Write again *.exe on the command line. . . "
- m cmd.clear "*.exe" cmd!
- " Then press AltP. . . "
- m AltP
- " This replaced the pattern at the top of your panel with
- one ending in `.exe', and displays only those files.
- We can (and will now) display again all the files by pressing AltP when
- there is no pattern on the command line.
- Now, let us go to the end of the list of files in the panel
- by pressing 'CtrlPgDn'. . . "
- m AltP CtrlPgDn
- " MSH can do yet other things for you. Suppose you want to position
- the cursor on the first file starting with a `.' in the panel;
- write `.' on the command line.."
- m "." cmd!
- " Then press AltF (`Find'). . . "
- m AltF
- " We are now positioned on the file '..' (the 'father' of the current
- directory). When you point to a file, MSH 'guesses' what you want to
- do with it and does that when you press return. When you point to a
- directory, you probably want to attach to it. Let's press Enter. . . "
- m Enter
- " Since we are positioned where we came from, Enter again will get us
- back to our directory. . . "
- m Enter
- " Enter guesses what you want to do with other files by looking at their
- extension. A particularly spectacular feat is what we do with .zip
- archives: we can explore them just as if they were ordinary directories.
- Let's position ourselves on the toolkit.zip file by typing its name
- on the command line.."
- m "toolkit.zip" cmd!
- " Then pressing AltF .."
- m AltF
- "toolkit.zip" current.name =
- (
- " Now press enter on it .."
- m Enter
- " Here! Doesn't it look like an ordinary directory? We can even
- do most actions as if in a directory. Let's position on the
- toolkit.doc file .."
- m "toolkit.doc" cmd! AltF
- " And Browse through it by pressing the browser key, F3 (this
- may fail if you don't have the program pkunzip.exe on your path).
- To exit the browser and go back to the tutorial, press Esc .."
- m F3
- " We exit the zip file just as we would a directory, by CtrlPgUp
- which goes to the \"father\" directory.."
- m CtrlPgUp
- )
- (
- " apparently you do not have toolkit.zip in this directory.
- We cannot show you what we wanted. Put toolkit.zip in this
- directory and reexecute the tutorial."
- m
- )ifelse
- " We have not yet spoken of the main quality of MSH: complete
- configurability obtained by programming yourself what it does.
- You may execute MSH script instructions by putting them in a
- script file like the one we are executing from now;
- you may also, as we have set things, execute them by writing
- them on the command line and pressing AltX.
- `beep' is an MSH instruction,
- let's write it to the command line. . . "
- m "beep"cmd!
- " And execute it by pressing AltX. . . "
- m AltX
- " As another example, a roundabout way to go Down is to write `Down'
- on the command line"
- m "Down" cmd!
- " And then press AltX"
- m AltX
- " Yet another example: we can alternate between the 2-line top menu
- and the 1-line top menu by pressing ShiftF4. . . "
- m ShiftF4
- " You should now explore the built-in Help panels, and when you are
- ready to start programming, run the advanced tutorial."
- m
- "end of demo"
- " You should now have a good idea of what's going on,
- so it's your turn to play. . . "
- message
- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-