home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / msh21b.zip / MSHFILES.ZIP / DEMO.MSH < prev    next >
Text File  |  1992-08-08  |  8KB  |  200 lines

  1. |  file DEMO.MSH        Introduction to Mi-Shell, a tutorial
  2. clean_stack
  3. "Welcome to MSH"
  4. " Copyright(C) PMC/OPENetwork 1989-1992              Author: Jean MICHEL "
  5. message                 | the message command needs 2 arguments.
  6. ("Demo" swap message)m! | here we define m on the fly which will need only 1.
  7. " MSH is a DOS \"shell\" which provides a convenient and CONFIGURABLE way
  8.  to browse through directories and execute commands on files and sets of 
  9.  files by a `point and shoot' interface."m
  10. "  This demonstration has been designed to perform best if you
  11.   start it in a directory which contains a lot of files and is not
  12.   your root directory. The directory where you keep your MSH files, if
  13.   you have one, is a good candidate. If you are not there, we'll take
  14.   you there. Of course, you can always abort from MSH by pressing CtrlC, 
  15.   and answering Yes."m 
  16. prog_dir cwd! refresh Tab prog_dir cwd! refresh Tab
  17. " You can move up and down panels with Up and Down keys on your
  18.  numeric pad. We go down one file. . . "m 
  19. Down
  20. " another . . . "
  21. m Down
  22. " yet another . . . "
  23. m Down
  24. " then up . . . "
  25. m Up
  26. " You can go down one screen with the PgDn key. . . "
  27. m PgDn
  28. " And back up one screen with PgUp. . . "
  29. m PgUp
  30. "  Let's look at the ways we may sort the panels.
  31.   By default, they are sorted alphabetically. Let's
  32.   sort the current panel by size by pressing AltS. . . "
  33. m AltS
  34. " Notice that the title 'size' at the bottom of the panel became
  35.  highlighted. Let's sort now by extension (pressing AltE)
  36.  and notice what happens to the highlighted titles at the bottom of the
  37.  panel. . . "
  38. m AltE
  39. " `ext' is now highlighted, but `size' too: this reflects the
  40.   fact that we kept the last sort (by size) as a secondary sort.
  41.   We have to do AltN to sort again alphabetically. . . "
  42. m AltN
  43. " You can expand the current panel with the CtrlE key . . . "
  44. m CtrlE
  45. " And trim it with the CtrlT key . . . "
  46. m CtrlT
  47. " Let's trim it again . . . "
  48. m CtrlT
  49. " You can go to the other panel with the Tab key. . . "
  50. m Tab
  51. " You can even swap the panels with CtrlU. . . "
  52. m CtrlU
  53. " And switch them off with CtrlO. . . "
  54. m CtrlO
  55. "     Oops! we don't want to do that yet. . . 
  56.   Before we return with CtrlO, do notice the little 
  57.   magic indicator window on the top right. This shows 
  58.   if swapping is on and lets you change its type 
  59.   (to disk or XMS) by clicking on this window.  
  60.   It also reminds you that Mi-Shell is active
  61.   (Magic is explained at the end of this tutorial)."
  62. m CtrlO
  63. cmd.clear "Hello! I am the command line" cmd!
  64. " All this may be mildly interesting, but to really DO something,
  65.  we must execute commands. Let's look at the command line."
  66. m
  67. " Let us clear the command line by pressing Esc  "
  68. m cmd.clear
  69. " You may use the command line to execute commands, of course. . . "
  70. m cmd.clear "DIR" dup cmd! execsave
  71. " You have better facilities to edit this line than DOS provides. 
  72.  Look at the command line. . . "
  73. m cmd.clear "Hello! I am the command line" cmd!
  74. " We press Home to go to its beginning. . . "
  75. m Home
  76. " Notice this did not destroy its content. We go a couple characters
  77.  Right by pressing Right twice. . . "
  78. m Right Right
  79. " Then go in insert mode by pressing Insert. . . "
  80. m Insert
  81. " You may notice that the cursor shape has changed. Let us
  82.  write a couple characters, then go back to replace mode
  83.  by pressing Insert again. . . "
  84. m "ZZ" cmd! Insert
  85. " go two words right by pressing CtrlRight twice. . . "
  86. m CtrlRight CtrlRight
  87. " then write again 4 characters. . . ."
  88. m "AAAA" cmd!
  89. " With the CtrlHome key, 
  90.  you may even recall previous commands in order to edit one . . ."
  91. m CtrlHome " " cmd!
  92. " There are other ways to use MSH's facilities to do things more 
  93.  conveniently. For instance, you may press CtrlJ to write to the 
  94.  command line the name of the file currently pointed to in the panel. . . "
  95. m CtrlJ
  96. "  If you have several file names to write, it's a good time to start
  97.   using the facilities of MSH to select groups of files. Let's go down
  98.   one file with the Down key and SELECT it by pressing F2. . . "
  99. m Down F2
  100. " Let's go down a couple of files. . . "
  101. m Down Down
  102. " And select another one. . . "
  103. m F2
  104. " And write both files' names to the command line by pressing CtrlA "
  105. m CtrlA
  106. " There are more efficient ways to select files. To select all files 
  107.  with an extension of exe, write `*.exe' on the command line. . . "
  108. m cmd.clear "*.exe" cmd!
  109. " Then press GreyPlus. . . "
  110. m GreyPlus
  111. " Actually, if you are only interested in `.exe' files, you may discard all
  112.  the other ones from your panel. Write again *.exe on the command line. . . "
  113. m cmd.clear "*.exe" cmd!
  114. " Then press AltP. . . "
  115. m AltP
  116. " This replaced the pattern at the top of your panel with
  117.  one ending in `.exe', and displays only those files.
  118.  We can (and will now) display again all the files by pressing AltP when 
  119.  there is no pattern on the command line.
  120.  Now, let us go to the end of the list of files in the panel 
  121.  by pressing 'CtrlPgDn'. . . "
  122. m AltP CtrlPgDn
  123. " MSH can do yet other things for you. Suppose you want to position 
  124.  the cursor on the first file starting with a `.' in the panel; 
  125.  write `.' on the command line.."
  126. m "." cmd!
  127. " Then press AltF (`Find'). . . "
  128. m AltF
  129. " We are now positioned on the file '..' (the 'father' of the current
  130.   directory). When you point to a file, MSH 'guesses' what you want to
  131.   do with it and does that when you press return. When you point to a
  132.   directory, you probably want to attach to it. Let's press Enter. . . "
  133. m Enter
  134. " Since we are positioned where we came from, Enter again will get us
  135.   back to our directory. . . "
  136. m Enter
  137. "  Enter guesses what you want to do with other files by looking at their
  138.   extension. A particularly spectacular feat is what we do with .zip
  139.   archives: we can explore them just as if they were ordinary directories.
  140.   Let's position ourselves on the toolkit.zip file by typing its name
  141.   on the command line.."
  142. m "toolkit.zip" cmd!
  143. " Then pressing AltF .."
  144. m AltF
  145. "toolkit.zip" current.name = 
  146. (
  147. " Now press enter on it .."
  148. m Enter
  149. " Here! Doesn't it look like an ordinary directory? We can even
  150.   do most actions as if in a directory. Let's position on the
  151.   toolkit.doc file .."
  152. m "toolkit.doc" cmd! AltF
  153. " And Browse through it by pressing the browser key, F3 (this
  154.   may fail if you don't have the program pkunzip.exe on your path).
  155.   To exit the browser and go back to the tutorial, press Esc .."
  156. m F3
  157. " We exit the zip file just as we would a directory, by CtrlPgUp
  158.   which goes to the \"father\" directory.."
  159. m CtrlPgUp
  160. )
  161. " apparently you do not have toolkit.zip in this directory.
  162.   We cannot show you what we wanted. Put toolkit.zip in this
  163.   directory and reexecute the tutorial."
  164. m
  165. )ifelse
  166. " We have not yet spoken of the main quality of MSH: complete 
  167.   configurability obtained by programming yourself what it does. 
  168.   You may execute MSH script instructions by putting them in a 
  169.   script file like the one we are executing from now; 
  170.   you may also, as we have set things, execute them by writing
  171.   them on the command line and pressing AltX. 
  172.    `beep' is an MSH instruction,
  173.   let's write it to the command line. . . "
  174. m "beep"cmd!
  175. " And execute it by pressing AltX. . . "
  176. m AltX
  177. " As another example, a roundabout way to go Down is to write `Down'
  178.   on the command line"
  179. m "Down" cmd!
  180. " And then press AltX"
  181. m AltX
  182. " Yet another example: we can alternate between the 2-line top menu 
  183.  and the 1-line top menu by pressing ShiftF4. . . "
  184. m ShiftF4
  185. " Running a program with magic means that most of the RAM used by
  186.  MSH is swapped to XMS or disk before the program is run. This means 
  187.  that it is unlikely that your program will be unable to load.
  188.  If magic is off, there is a small speed improvement while your program
  189.  will have less RAM available."
  190. m
  191. " You should now explore the built-in Help panels, and when you are 
  192.  ready to start programming, run the advanced tutorial."
  193. m
  194. "end of demo"
  195. " You should now have a good idea of what's going on,
  196.   so it's your turn to play. . . "
  197. message
  198. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  199.