home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / m / msh_ut11.zip / MYDEFS.ZIP / DEMO.MSH < prev    next >
Text File  |  1992-03-29  |  8KB  |  193 lines

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