home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / os2 / 4os2b.zip / 4OS2.INF (.txt) < prev    next >
OS/2 Help File  |  1993-12-16  |  336KB  |  10,608 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. About 4OS2 Help ΓòÉΓòÉΓòÉ
  3.  
  4.                               4OS2 2.0 Help System
  5.  
  6.                 Text by Hardin Brothers, Tom Rawson, and Rex Conn
  7.  
  8. Program and Text Copyright 1988 - 1993, JP Software Inc., All Rights Reserved. 
  9.  
  10. Copyright 1993, JP Software Inc., All Rights Reserved. 4OS2 is a trademark and 
  11. 4DOS is a registered trademark of JP Software Inc.  OS/2 is a registered 
  12. trademark of IBM Corporation.  Other product and company names are trademarks 
  13. of their respective owners. 
  14.  
  15. [12/93-2.0A] 
  16.  
  17.  
  18. ΓòÉΓòÉΓòÉ 2. Using the 4OS2 Help System ΓòÉΓòÉΓòÉ
  19.  
  20. This online help system for 4OS2 covers all 4OS2 features and internal 
  21. commands.  It includes reference information to assist you in using 4OS2 and 
  22. developing batch files; however it does not include all of the details which 
  23. are included in the printed 4OS2 manuals. 
  24.  
  25. If you type part or all of a command on the line and then press F1, the help 
  26. system will provide "context-sensitive" help by using the first word on the 
  27. line as a help topic.  If it's a valid topic, you will see help for that topic 
  28. automatically; if not, you will see the list of all help topics and you can 
  29. pick the one you want. 
  30.  
  31. You can use this feature to obtain help on any topic -- not just on commands. 
  32. For example, if you enter the command HELP _DISK you will see help for the 
  33. _DISK internal variable. 
  34.  
  35. If you type the name of any internal command at the prompt, followed by a slash 
  36. and a question mark [/?] like this: 
  37.  
  38.         copy /?
  39.  
  40. then you will see help for the command in a "quick-reference" style.  Output 
  41. from a /? display may be redirected with > or >>. 
  42.  
  43. The /? option may not work correctly if you have used an alias to redefine how 
  44. an internal command operates.  To view the /? help for such a command you must 
  45. add an asterisk to the beginning of the command to disable alias processing. 
  46. For example, if you have defined this alias: 
  47.  
  48.         alias copy *copy /r
  49.  
  50. then the command COPY /? will be translated to COPY /R /?, which will not work 
  51. properly.  However, if you use *COPY /?, the alias will be ignored and the /? 
  52. will work as you intended. 
  53.  
  54. The 4OS2 help system uses OS/2's VIEW.EXE to display this help text. Once 
  55. you've started the help system with HELP or F1, you can use VIEW's standard 
  56. keystrokes to navigate.  For more information, click on the Help menu at the 
  57. top of the VIEW window. 
  58.  
  59. Configuring the Help System 
  60.  
  61. You can select which help "books" are displayed when you press the F1 key or 
  62. enter the HELP command.  A help book is a single .INF file.  This help text is 
  63. in the file 4OS2.INF. 
  64.  
  65. By default, 4OS2 opens this book and the OS/2 command reference file, 
  66. CMDREF.INF.  You can change the default books opened for the 4OS2 help system 
  67. with the HelpBook directive in 4OS2.INI.  The default setting is 4OS2+CMDREF. 
  68. For example, to load only the 4OS2 help when you press F1 or enter the HELP 
  69. command: 
  70.  
  71.         HelpBook = 4OS2
  72.  
  73.  
  74. ΓòÉΓòÉΓòÉ 3. Conventions ΓòÉΓòÉΓòÉ
  75.  
  76. This section contains information about conventions that are used throughout 
  77. 4OS2: 
  78.  
  79.             Colors and color names 
  80.             Color-coded directories 
  81.             Keys and key names 
  82.  
  83.  These topics are combined here in a central reference spot so that they will 
  84.  be easy to find when you need to refer to them.  You will find cross 
  85.  references to this section throughout the help system. 
  86.  
  87.  
  88. ΓòÉΓòÉΓòÉ 3.1. Colors and Color Names ΓòÉΓòÉΓòÉ
  89.  
  90. You can use color names in several of the directives in the .INI file and in 
  91. many commands.  The general form of a color name is: 
  92.  
  93.     [BRIght] [BLInk] fg ON [BRIght] bg [BORder bc ] 
  94.  
  95. where fg is the foreground or text color, bg is the background color, and bc is 
  96. the border color. 
  97.  
  98. The available colors are: 
  99.  
  100.         Black           Blue            Green           Red
  101.         Magenta         Cyan            Yellow          White
  102.  
  103. Color names and the words BRIght, BLInk, and BORder may be shortened to the 
  104. first 3 letters. 
  105.  
  106. There are several subtleties that complicate the use of colors and color names. 
  107. In order to understand them, you will need to read through the restrictions 
  108. described below.  These restrictions are due to the design of your PC video 
  109. hardware and video drivers, and are not inherent in 4OS2.  Some of the 
  110. restrictions are complex, so feel free to skip over those that do not apply to 
  111. color combinations you use. 
  112.  
  113. Some restrictions depend on the display "mode."  4OS2 can run in either normal 
  114. display mode, where it uses the full screen and has more direct control over 
  115. the video hardware; or in windowed display mode, where it appears in a window 
  116. on the OS/2 desktop. 
  117.  
  118. Monochrome Video Adapters 
  119.  
  120. If you have a monochrome video adapter, you cannot display any colors except 
  121. white and black in either normal or bright intensity. If you have a color video 
  122. adapter, you can use any of the standard colors listed above (provided you meet 
  123. the other restrictions below). 
  124.  
  125. Color Errors 
  126.  
  127. A standard color specification allows sixteen foreground and eight background 
  128. colors (sixteen if bright backgrounds are enabled, see below).  However, most 
  129. video adapters and monitors do not provide true renditions of certain colors. 
  130. For example, most users see normal "yellow" as brown, and bright yellow as 
  131. yellow; many also see normal red as red, and "bright red" as pink.  Color 
  132. errors are often much worse when running in windowed mode (see above), because 
  133. the graphical environment that created the window may not map the text-mode 
  134. colors the way you expect.  These problems are inherent in the monitor, video 
  135. adapter, and driver software.  They cannot be corrected using 4OS2 color 
  136. specifications. 
  137.  
  138. Border Colors 
  139.  
  140. In order to use border colors, you must have a color video adapter (monochrome 
  141. adapters do not support border colors). 
  142.  
  143. 4OS2 can only accept border colors in the CLS and COLOR commands, and in the 
  144. StdColors directive in the .INI file.  Border colors will be ignored, or will 
  145. cause an error, if they are used elsewhere. 
  146.  
  147. Border colors do not work in windowed mode, and will be ignored if used in a 
  148. windowed session under OS/2. 
  149.  
  150. Blinking Text and Bright Background Colors 
  151.  
  152. The interactions between blinking characters, bright backgrounds, and your 
  153. display mode can be complex.  You will need to understand them if you use 
  154. either attribute in your color specifications. 
  155.  
  156. Bright background colors are only available if you have an EGA- or 
  157. VGA-compatible display adapter.  If you have a monochrome or CGA adapter, you 
  158. can use blinking displays and ignore the interactions described below. 
  159.  
  160. The effects of blinking and bright background color specifications depend 
  161. partly on whether you are in normal or windowed display mode. 
  162.  
  163. Full-Screen Display Mode 
  164.  
  165. In full-screen display mode your video hardware can be configured via software 
  166. commands to display either blinking text, or text with a bright background, but 
  167. not both.  This is due to the design of PC video hardware, and is not a 
  168. software restriction. 
  169.  
  170. The memory on your video adapter includes a "flag" for each character on the 
  171. screen.  The flag controls blinking text and bright background colors.  If the 
  172. flag is off, the character is displayed with a normal background and does not 
  173. blink.  If the flag is "on," the character either blinks or is displayed with a 
  174. bright background, depending on which way your video adapter is currently 
  175. configured. 
  176.  
  177. In full-screen display mode, the configuration of your video adapter can be 
  178. controlled by 4OS2 with the BrightBG directive in the 4OS2.INI file or the 
  179. SETDOS /B command.  If you set BrightBG = No or use the SETDOS /B0 command, 
  180. 4OS2 will configure the video adapter for blinking text, and characters with 
  181. the blink / bright background flag set will blink.  If you set BrightBG = Yes 
  182. or use SETDOS /B1, 4OS2 will configure the video adapter for bright background 
  183. colors, and the characters will be displayed with a bright background instead. 
  184.  
  185. Because there is only one flag for each character to specify both blinking text 
  186. and bright background color, it doesn't matter which attribute you use when you 
  187. specify the color.  Whether you specify blinking text or a bright background, 
  188. you will see the same thing on your screen.  For example, these two COLOR 
  189. commands will always produce the same results: 
  190.  
  191.         color blink white on blue
  192.         color white on bright blue
  193.  
  194. If bright backgrounds are enabled, both commands will produce white text on a 
  195. bright blue background.  If blinking text is enabled, both commands will 
  196. produce blinking white text on a blue background. 
  197.  
  198. If you don't use BrightBG or SETDOS /B, 4OS2 will not attempt to configure your 
  199. video hardware.  Most video adapters default to blinking text in normal mode, 
  200. but this can be changed by application programs.  If you use BrightBG or SETDOS 
  201. /B, 4OS2 will configure the hardware each time they display the prompt. 
  202.  
  203. The method used to adjust the video hardware may not be compatible with all 
  204. video cards.  If you see screen "flashes" at each prompt when you use BrightBG 
  205. or SETDOS /B, discontinue using both commands.  This problem is very rare and 
  206. is not likely to occur on standard EGA and VGA systems. 
  207.  
  208. Windowed Mode 
  209.  
  210. In windowed mode, 4OS2 cannot control your hardware to select blinking or 
  211. bright backgrounds.  Instead, OS/2 displays bright background colors, 
  212. regardless of the BrightBG or SETDOS /B setting.  It does not provide a way to 
  213. display blinking characters in windowed mode.  As an example, the two commands 
  214. given above would both display white text on a bright blue background when run 
  215. in windowed mode. 
  216.  
  217. Switching Modes 
  218.  
  219. OS/2 allows you to switch any DOS session between full- screen and windowed 
  220. mode.  You cannot switch modes for OS/2 sessions, so 4OS2 is not directly 
  221. affected by mode switching. However, if you write batch files or aliases which 
  222. run in both modes, you may need to take into account that OS/2 defaults to 
  223. displaying blinking text in full-screen mode and bright backgrounds in windowed 
  224. mode. 
  225.  
  226.  
  227. ΓòÉΓòÉΓòÉ 3.2. Color-Coded Directories ΓòÉΓòÉΓòÉ
  228.  
  229. The DIR and SELECT commands can display each file name in a different color, 
  230. depending on the file's extension. 
  231.  
  232. To choose the DIR and SELECT display colors, you must either use the SET 
  233. command to create an environment variable called COLORDIR, or use the ColorDir 
  234. directive in your .INI file. 
  235.  
  236. If you do not use the COLORDIR variable or the ColorDir directive, DIR will use 
  237. the default screen colors and SELECT will use the default screen colors or 
  238. those set with the SelectColors directive. 
  239.  
  240. If you use both the COLORDIR variable and the ColorDir directive, the 
  241. environment variable will override the settings in your .INI file.  You may 
  242. find it useful to use the COLORDIR variable for experimenting, then to set 
  243. permanent directory colors with the ColorDir directive. 
  244.  
  245. The format for both the COLORDIR environment variable and the ColorDir 
  246. directive in the .INI file is: 
  247.  
  248.         ext ... :ColorName; ...
  249.  
  250. where "ext" is a file extension (which may include wildcards) or one of the 
  251. following file types: 
  252.  
  253.         DIRS      Directories
  254.         RDONLY    Read-only files
  255.         HIDDEN    Hidden files
  256.         SYSTEM    System files
  257.         ARCHIVE   Files modified since the last backup
  258.  
  259. and "ColorName" is any valid color name (see Colors). 
  260.  
  261. Unlike most color specifications, the background portion of the color name may 
  262. be left out for directory colors.  If you don't specify a background color, DIR 
  263. and SELECT will use the current screen background color. 
  264.  
  265. For example, to display the .COM and .EXE files in red on the current 
  266. background, the .C and .ASM files in bright cyan on the current background, and 
  267. the read-only files in blinking green on white (this should be entered on one 
  268. line): 
  269.  
  270.         [c:\] set colordir=com exe:red; c asm:bright cyan; rdonly:blink green on white
  271.  
  272. Extended wildcards (for example "BA[KXC]" for .BAK, .BAX, and .BAC files) can 
  273. be used in directory color specifications. 
  274.  
  275.  
  276. ΓòÉΓòÉΓòÉ 3.3. Keys and Key Names ΓòÉΓòÉΓòÉ
  277.  
  278. Key names are used to define keystroke aliases, and in several 4OS2.INI 
  279. directives.  The format of a key name is the same in both uses: 
  280.  
  281.         [Prefix-]Keyname
  282.  
  283. The key prefix can be left out, or it can be any one of the following: 
  284.  
  285.         Alt         followed by A - Z, 0 - 9, F1 - F12, or Bksp
  286.         Ctrl        followed by A - Z, F1 - F12, Tab, Bksp, Enter,
  287.                       Left, Right, Home, End, PgUp, PgDn, Ins, or Del
  288.         Shift       followed by F1 - F12 or Tab.
  289.  
  290. The possible key names are: 
  291.  
  292.         A - Z           Enter           PgDn
  293.         0 - 9           Up              Home
  294.         F1 - F          Down            End
  295.         Esc             Left            Ins
  296.         Bksp            Right           Del
  297.         Tab             PgUp
  298.  
  299. All key names must be spelled as shown.  Alphabetic keys can be specified in 
  300. upper-case or lower-case.  You cannot specify a punctuation key. 
  301.  
  302. The prefix and key name must be separated by a dash [-].  For example: 
  303.  
  304.         Alt-F10        This is okay
  305.         Alt F10        The space will cause an error
  306.  
  307. If you prefer, you can use a numeric value instead of a key name. Use the ASCII 
  308. code for an ASCII, extended ASCII, or control character.  Use the scan code 
  309. preceded by an at sign [@] for extended key codes like F1 or the cursor keys. 
  310. For example, use 13 for Enter, or @59 for F1.  In general, you will find it 
  311. easier to use the names described above rather than key numbers. See see the 
  312. Reference Tables for an explanation and list of ASCII and key codes. 
  313.  
  314. Some keys are intercepted by OS/2 and are not passed on to 4OS2.  For example, 
  315. Ctrl-S pauses screen output temporarily, and Ctrl-Esc pops up the OS/2 window 
  316. list.  Keys which are intercepted by OS/2 generally cannot be assigned to 
  317. aliases or with key mapping directives, because 4OS2 never receives these 
  318. keystrokes and therefore cannot act on them. 
  319.  
  320. You also may not be able to use certain keys if your keyboard is not 100% 
  321. IBM-compatible or your keyboard driver does not support them.  For example, on 
  322. some systems the F11 and F12 keys are not recognized; others may not support 
  323. unusual combinations like Ctrl-Tab.  These problems are rare; when they do 
  324. occur, they are usually due to OS/2 and not to any problem with 4OS2. 
  325.  
  326.  
  327. ΓòÉΓòÉΓòÉ 4. 16-Bit and 32-Bit Versions of 4OS2 ΓòÉΓòÉΓòÉ
  328.  
  329. 4OS2 comes in two versions:  32-bit (4OS2/32) and 16-bit (4OS2/16).  If you use 
  330. OS/2 version 2.1, you will find that 4OS2/32 offers a few improvements and runs 
  331. a bit faster than 4OS2/16.  Normally, the correct version is selected for you 
  332. automatically by the 4OS2 INSTALL program.  If you are using a downloaded copy 
  333. of 4OS2, see the README.DOC file which came with your copy for details on 
  334. selecting the appropriate files for your system. 
  335.  
  336. Once the proper version is selected during installation, you generally don't 
  337. need to be concerned with which version you are using, as the two versions are 
  338. almost identical.  A few features are available only in the 32-bit version; 
  339. these are marked as such in this help text and in the manuals. 
  340.  
  341. If necessary, you can install the 16-bit or 32-bit version explicitly rather 
  342. than letting the installation program choose for you.  To do so, start the 
  343. installation program (see page 4) and select the Install 16-bit Version or 
  344. Install 32-bit Version option.  These options install only the files which 
  345. differ between the two versions:  4OS2.EXE, SHRALIAS.EXE, 4OS2A.ICO, and 
  346. 4OS2B.ICO. 
  347.  
  348. 4OS2/16 runs under OS/2 1.21, 1.3, 2.0, and 2.1.  4OS2/32 normally runs only 
  349. under OS/2 2.1.  You can install it manually for OS/2 2.0 if you wish, but some 
  350. features may not work properly due to problems with 32-bit support in some 
  351. versions of OS/2 2.0. 
  352.  
  353.  
  354. ΓòÉΓòÉΓòÉ 5. Startup ΓòÉΓòÉΓòÉ
  355.  
  356. Each 4OS2 object on your OS/2 desktop represents a different 4OS2 session.  You 
  357. can configure any of these sessions to run in windowed or full-screen mode, and 
  358. you can set any necessary command line parameters for 4OS2, by adjusting the 
  359. properties of the desktop objects. 
  360.  
  361. To adjust the properties of an object you need to be familiar with how object 
  362. properties are set in your version of OS/2.  For details see your OS/2 
  363. documentation, or the 4OS2 Introduction and Installation Guide. 
  364.  
  365. When you configure a 4OS2 object, place an asterisk [*] in the Program Name 
  366. field, and put any startup options that you want passed to 4OS2 (e.g., 
  367. @inifile) in the Parameters field.  For example: 
  368.  
  369.      Path and file name:  *
  370.      Parameters:          @D:\START\4OS2.INI
  371.      Working directory:   C:\
  372.  
  373. (If 4OS2 is not set up as your default OS/2 shell in CONFIG.SYS, use the full 
  374. path and name for 4OS2.EXE as the program name, rather than the asterisk.) 
  375.  
  376. The 4OS2 command line does not need to contain any information.  When invoked 
  377. with an empty command line, 4OS2 will configure itself from the 4OS2.INI file, 
  378. run 4START, and then display a prompt and wait for you to type a command. 
  379. However, you may add options on the 4OS2 command line to change the way 4OS2 
  380. operates. 
  381.  
  382. 4OS2 recognizes several optional fields on the command line. All of the options 
  383. go on one line.  If you use more than one of these fields, their order is 
  384. important.  The syntax for the command line is: 
  385.  
  386.         [d:\path] [@d:\path\inifile] [//iniline]... [/L] [/LA] [/LH] [/S] [/C | 
  387.         /K] [command] 
  388.  
  389.  The options are: 
  390.  
  391.         d:\path:  4OS2 will use this directory and path to set the COMSPEC 
  392.         environment variable for this session.  If this option is not used, 
  393.         COMSPEC is set from the location of 4OS2.EXE.  4OS2 always knows what 
  394.         drive and directory it was started from and can set COMSPEC 
  395.         accordingly.  This option is included only for compatibility with 
  396.         CMD.EXE. 
  397.  
  398.         @d:\path\inifile:  This option sets the path and name of the 4OS2.INI 
  399.         file.  You do not need this option if you aren't using a 4OS2.INI file, 
  400.         or if the file is named 4OS2.INI and is stored in the same subdirectory 
  401.         as 4OS2.EXE or in the root directory of the boot drive. 
  402.  
  403.         //iniline:  This option tells 4OS2 to treat the text appearing between 
  404.         the // and the next space or tab as a 4OS2.INI directive.  The 
  405.         directive should be in the same format as a line in 4OS2.INI, but it 
  406.         may not contain spaces, tabs, or comments.  This option overrides any 
  407.         corresponding directive in your 4OS2.INI file. 
  408.  
  409.         /L, /LA, and /LH:  These options force 4OS2 to use a local alias and / 
  410.         or history list.  This allows you to use global aliases as the default, 
  411.         but start a specific 4OS2 session with local aliases or history.  See 
  412.         ALIAS for details on local and global aliases, and Command History for 
  413.         details on local and global history.  /LA forces local aliases, /LH 
  414.         forces local history, and /L forces both local aliases and local 
  415.         history. 
  416.  
  417.         /S:  This option tells 4OS2 that you do not want it to set up a Ctrl-C 
  418.         / Ctrl-Break handler.  It is included for compatibility with CMD.EXE, 
  419.         but it may cause the system to operate incorrectly if you use this 
  420.         option without other software to handle Ctrl-C and Ctrl-Break. 
  421.  
  422.         [/C | /K] command:  This option tells 4OS2 to run a command when it 
  423.         starts.  The command will be run after 4START has been executed and 
  424.         before any command prompt is displayed.  It can be any valid internal 
  425.         or external command, batch file, or alias; you may include multiple 
  426.         commands by using the command separator.  All other startup options 
  427.         must be placed before the command, because 4OS2 will treat characters 
  428.         after the command as part of the command and not as additional startup 
  429.         options. 
  430.  
  431.         When the command is preceded by a /C, 4OS2 will execute the command and 
  432.         then exit and return to the parent program or the OS/2 desktop without 
  433.         displaying a prompt. 
  434.  
  435.         The /K switch has no effect; using it is the same as placing the 
  436.         command (without a /C or /K) at the end of the startup command line. 
  437.         It is included only for compatibility with CMD.EXE. 
  438.  
  439.  To run a startup batch file for a particular 4OS2 session, include its name 
  440.  (with a path, if the batch file is not in the session's startup directory) as 
  441.  the last item in the Parameters field when you configure the desktop object. 
  442.  That batch file will be executed after any 4START file, but before the first 
  443.  prompt is displayed.  You can use the batch file to set environment variables 
  444.  and execute any other 4OS2 commands. 
  445.  
  446.  You can also execute any internal 4OS2 command, external command, or alias by 
  447.  placing its name in the Parameters field.  For example: 
  448.  
  449.        Path and file name:  *
  450.        Parameters:          D:\STARTOS2.CMD
  451.        Working directory:   C:\
  452.  
  453.  To execute an internal or external command, an alias, or a batch file and then 
  454.  exit (return to the desktop) when it is done, place /C command (rather than 
  455.  just command) as the last item in the Parameters field.  For example: 
  456.  
  457.        Path and file name:  *
  458.        Parameters:          /C COMFILES.BTM
  459.        Working directory:   C:\
  460.  
  461.  
  462. ΓòÉΓòÉΓòÉ 6. The Command Line ΓòÉΓòÉΓòÉ
  463.  
  464. 4OS2 displays a [c:\] prompt when it is waiting for you to enter a command. 
  465. (The actual text depends on the current drive and directory as well as your 
  466. PROMPT settings.)  This is called the command line and the prompt is asking you 
  467. to enter a command, an alias or batch file name, or the instructions necessary 
  468. to begin an application program. 
  469.  
  470. This section explains the features that will help you while you are typing in 
  471. commands, and how keystrokes are interpreted when you enter them at the command 
  472. line.  The keystrokes discussed here are the ones normally used by 4OS2.  If 
  473. you prefer using different keystrokes to perform these functions, you can 
  474. assign new ones with key mapping directives in the .INI file. 
  475.  
  476. The command line features documented in this section are: 
  477.  
  478.             Command-Line Editing 
  479.             Command History and Recall 
  480.             Command History Window 
  481.             Filename Completion 
  482.             Directory History Window 
  483.             Automatic Directory Changes 
  484.             Multiple Commands 
  485.             Command-Line Length Limits 
  486.             Page and File Prompts 
  487.             Conditional Commands 
  488.             Command Grouping 
  489.             Escape Character 
  490.             Critical Errors 
  491.  
  492.  Additional command-line features are documented under Redirection and Piping 
  493.  and File Selection. 
  494.  
  495.  
  496. ΓòÉΓòÉΓòÉ 6.1. Command-Line Editing ΓòÉΓòÉΓòÉ
  497.  
  498. The command line works like a single-line word processor, allowing you to edit 
  499. any part of the command at any time before you press Enter to execute it, or 
  500. Esc to erase it.  The command line extends to a maximum of 1023 characters. 
  501.  
  502. You can use the following editing keys when you are typing a command (the words 
  503. Ctrl and Shift mean to press the Ctrl or Shift key together with the other key 
  504. named): 
  505.  
  506. Cursor Movement Keys: 
  507.  
  508.                        Move the cursor left one character. 
  509.                        Move the cursor right one character. 
  510.         Ctrl           Move the cursor left one word. 
  511.         Ctrl           Move the cursor right one word. 
  512.         Home            Move the cursor to the beginning of the line. 
  513.         End             Move the cursor to the end of the line. 
  514.  
  515.  Insert and Delete: 
  516.  
  517.         Ins             Toggle between insert and overtype mode. 
  518.         Del             Delete the character at the cursor. 
  519.         Backspace       Delete the character to the left of the cursor. 
  520.         Ctrl-L          Delete the word or partial word to the left of the 
  521.                         cursor. 
  522.         Ctrl-R          or Ctrl-Bksp  Delete the word or partial word to the 
  523.                         right of the cursor. 
  524.         Ctrl-Home       Delete from the beginning of the line to the cursor. 
  525.         Ctrl-End        Delete from the cursor to the end of the line. 
  526.         Esc             Delete the entire line. 
  527.         Ctrl-C          or Ctrl-Break  Cancel the command. 
  528.         Enter           Execute the command line. 
  529.  
  530.  4OS2 will prompt for additional command-line text when you include the escape 
  531.  character as the very last character of a typed command line.  The default 
  532.  escape character is the caret [^].  For example: 
  533.  
  534.           [c:\] echo The quick brown fox jumped over the lazy^
  535.           More? sleeping dog. > alphabet
  536.  
  537.  Sometimes you may want to enter one of the above keystrokes on the command 
  538.  line instead of performing the key's usual action.  For example, suppose you 
  539.  have a program that requires a Ctrl-R character on its command line.  Normally 
  540.  you couldn't type this keystroke at the prompt, because it would be 
  541.  interpreted as a "Delete word right" command. 
  542.  
  543.  To get around this problem, use the special keystroke Alt-255. You enter 
  544.  Alt-255 by holding down the Alt key while you type 255 on the numeric keypad, 
  545.  then releasing the Alt key (you must use the number keys on the numeric pad; 
  546.  the row of keys at the top of your keyboard won't work).  This forces 4OS2 to 
  547.  interpret the next keystroke literally and places it on the command line, 
  548.  ignoring any special meaning it would normally have as a command- line editing 
  549.  or history keystroke.  You can use Alt-255 to suppress the normal meaning of 
  550.  command-line editing keystrokes even if they have been reassigned with key 
  551.  mapping directives in the .INI file, and Alt-255 itself can be reassigned with 
  552.  the CommandEscape directive. 
  553.  
  554.  If you want your input at the command line to be in a different color from 
  555.  4OS2's prompts or output, you can use the InputColors directive in your .INI 
  556.  file. 
  557.  
  558.  Most of the command-line editing capabilities are also available when a 4OS2 
  559.  command prompts you for a line of input.  For example, you can use the 
  560.  command-line editing keys when DESCRIBE prompts for a file description, when 
  561.  INPUT prompts for input from an alias or batch file, or when LIST prompts you 
  562.  for a search string. 
  563.  
  564.  
  565. ΓòÉΓòÉΓòÉ 6.2. Command History and Recall ΓòÉΓòÉΓòÉ
  566.  
  567. Command History Keys: 
  568.  
  569.                        Recall the previous (or most recent) command, or the 
  570.                         most recent command that matches a partial command 
  571.                         line. 
  572.                        Recall the next (or oldest) command, or the oldest 
  573.                         command that matches a partial command line. 
  574.         F3              Fill in the rest of the command line from the previous 
  575.                         command, beginning at the current cursor position. 
  576.         Ctrl-D          Delete the currently displayed history list entry, 
  577.                         erase the command line, and display the previous 
  578.                         matching history list entry. 
  579.         Ctrl-E          Display the last entry in the history list. 
  580.         Ctrl-K          Save the current command line in the history list 
  581.                         without executing it, and then clear the command line. 
  582.         @               As the first character in a line:  Do not save the 
  583.                         current line in the history list when it is executed, 
  584.                         and do not store it in the CMDLINE environment 
  585.                         variable. 
  586.  
  587.  Use the  key repeatedly to scan back through the history list.  When the 
  588.  desired command appears, press Enter to execute it again.  After you have 
  589.  found a command, you can edit it before pressing Enter. 
  590.  
  591.  The history list is "circular".  If you move to the last command in the list 
  592.  and then press the down arrow one more time, you'll see the first command in 
  593.  the list.  Similarly, if you move to the first command in the list and then 
  594.  press the up arrow one more time, you'll see the last command in the list. 
  595.  
  596.  You can search the command history list to find a previous command quickly 
  597.  using command completion.  Just enter the first few characters of the command 
  598.  you want to find and press . You only need to enter enough characters to 
  599.  identify the command that you want to find.  If you press the  key a second 
  600.  time, you will see the previous command that matches.  The system will beep if 
  601.  there are no matching commands.  The search process stops as soon as you type 
  602.  one of the editing keys, whether or not the line is changed.  At that point, 
  603.  the line you're viewing becomes the new line to match if you press  again. 
  604.  
  605.  You can specify the size of the command history list with the History 
  606.  directive in the .INI file.  When the list is full, the oldest commands are 
  607.  discarded to make room for new ones.  You can also use the HistMin directive 
  608.  in the .INI file to enable or disable history saves and to specify the 
  609.  shortest command line that will be saved. 
  610.  
  611.  You can prevent any command line from being saved in the history by beginning 
  612.  it with an at sign [@]. 
  613.  
  614.  When you execute a command from the history, that command remains in the 
  615.  history list in its original position.  The command is not copied to the end 
  616.  of the list (unless you modify it).  If you want each command to be copied to 
  617.  the end of the list when it is re- executed, set HistCopy to Yes in your .INI 
  618.  file. 
  619.  
  620.  Local and Global Command History 
  621.  
  622.  The command history can be stored in either a "local" or "global" list. 
  623.  
  624.  With a local history list, any changes made to the history will only affect 
  625.  the current copy of 4OS2.  They will not be visible in other shells, or other 
  626.  sessions. 
  627.  
  628.  With a global history list, all copies of 4OS2 will share the same command 
  629.  history, and any changes made to the history in one copy will affect all other 
  630.  copies.  Global lists are the default for 4OS2. 
  631.  
  632.  You can control the type of history list with the LocalHistory directive in 
  633.  the .INI file, and with the /L and /LH options of the START command. 
  634.  
  635.  If you select a global history list for 4OS2 you can share the history among 
  636.  all copies of 4OS2 running in any session.  When you close all 4OS2 sessions, 
  637.  the memory for the global history list is released, and a new, empty history 
  638.  list is created the next time you start 4OS2.  If you want the history list to 
  639.  be retained in memory even when no command processor session is running, you 
  640.  need to load the SHRALIAS program, which performs this service for the global 
  641.  history and alias lists.  SHRALIAS is described in more detail under the ALIAS 
  642.  command. 
  643.  
  644.  
  645. ΓòÉΓòÉΓòÉ 6.3. Command History Window ΓòÉΓòÉΓòÉ
  646.  
  647. Command History Window Keys: 
  648.  
  649.         PgUp            (from the command line) Open the command history 
  650.                         window. 
  651.          or PgDn 
  652.                        Scroll the display up one line. 
  653.                        Scroll the display down one line. 
  654.                        Scroll the display left 4 columns. 
  655.                        Scroll the display right 4 columns. 
  656.         PgUp            (inside the window) Scroll the display up one page. 
  657.         PgDn            (inside the window) Scroll the display down one page. 
  658.         Ctrl-PgUp       Go to the beginning of the history list. 
  659.          or Home 
  660.         Ctrl-PgDn       Go to the end of the history list. 
  661.          or End 
  662.         Ctrl-D          Delete the selected line from the history list. 
  663.         Enter           Execute the selected line. 
  664.         Ctrl-Enter      Move the selected line to the command line for editing. 
  665.  
  666.  You can view the command history in a scrollable command history window, and 
  667.  select the command to modify or re-execute from those displayed in the window. 
  668.  To activate the command history window press PgUp or PgDn at the command line. 
  669.  A window will appear in the upper right corner of the screen, with the command 
  670.  you most recently executed marked with a highlight. (If you just finished 
  671.  re-executing a command from the history, then the next command in sequence 
  672.  will be highlighted.) 
  673.  
  674.  Once you have selected a command in the history window, press Enter to execute 
  675.  it immediately, or Ctrl-Enter to move the line to the prompt for editing (you 
  676.  cannot edit the line directly in the history window). 
  677.  
  678.  You can bring up a "filtered" history window by typing some characters on the 
  679.  command line, then pressing PgUp or PgDn. Only those commands matching the 
  680.  typed characters will be displayed in the window. 
  681.  
  682.  You can control the position and size of the history window with configuration 
  683.  directives in 4OS2.INI.  You can also change the keys used in the window with 
  684.  key mapping directives in the .INI file. 
  685.  
  686.  
  687. ΓòÉΓòÉΓòÉ 6.4. Filename Completion ΓòÉΓòÉΓòÉ
  688.  
  689. Filename Completion Keys: 
  690.  
  691.         F8                  Get the previous matching filename. 
  692.          or Shift-Tab 
  693.         F9                  Get the next matching filename. 
  694.          or Tab 
  695.         F10                 Keep the current matching filename and display the 
  696.                             next matching name immediately after the current 
  697.                             one. 
  698.  
  699.  Filename completion can help you by filling in a complete file name on the 
  700.  command line when you only remember part of the name.  For example, if you 
  701.  know the name of a file begins AU but you can't remember the rest of the name, 
  702.  type: 
  703.  
  704.           [c:\] copy au
  705.  
  706.  and then press the Tab key or F9 key.  4OS2 will search the current directory 
  707.  for filenames that begin AU and insert the first one onto the command line in 
  708.  place of the AU that you typed. 
  709.  
  710.  If this is the file that you want, simply complete the command.  If 4OS2 
  711.  didn't find the file that you were looking for, press Tab or F9 again to 
  712.  substitute the next filename that begins with AU.  When there are no more 
  713.  filenames that match your pattern, the system will beep each time you press 
  714.  Tab or F9. 
  715.  
  716.  If you go past the filename that you want, press Shift-Tab or F8 to back up 
  717.  and return to the previous matching filename. After you back up to the first 
  718.  filename, the system will beep each time you press Shift-Tab or F8. 
  719.  
  720.  If you want to enter more than one matching filename on the same command line, 
  721.  press F10 when each desired name appears.  This will keep that name and place 
  722.  the next matching filename after it on the command line.  You can then use Tab 
  723.  (or F9) and Shift-Tab (or F8) to move through the remaining matching files. 
  724.  
  725.  The pattern you use for matching may contain any valid filename characters, as 
  726.  well as wildcard characters and extended wildcards.  For example, you can copy 
  727.  the first matching .TXT file by typing 
  728.  
  729.           [c:\] copy *.txt
  730.  
  731.  and then pressing Tab. 
  732.  
  733.  If you don't specify part of a filename before pressing Tab, the matching 
  734.  pattern will be *.*.  If you type a filename without an extension, 4OS2 will 
  735.  add *.* to the name.  It will also place a "*" after a partial extension.  If 
  736.  you are typing a group of file names in an include list, the part of the 
  737.  include list at the cursor will be used as the pattern to match. 
  738.  
  739.  When filename completion is used at the start of the command line, it will 
  740.  only match directories, executable files, and files with executable 
  741.  extensions, since these are the only file names that it makes sense to use at 
  742.  the start of a command.  If a directory is found, a "\" will be appended to it 
  743.  to enable an automatic directory change. 
  744.  
  745.  Filename Completion Window 
  746.  
  747.  You can also view filenames in a scrollable filename completion window and 
  748.  select the file you want to work with.  To activate the window, press F7 or 
  749.  Ctrl-Tab at the command line.  You will see a window in the upper-right corner 
  750.  of the screen, with the names of files that match any partial filename you 
  751.  have entered on the command line.  If you haven't yet entered a file name, the 
  752.  window will contain the name of all files in the current directory. (Ctrl-Tab 
  753.  will work only if your keyboard and keyboard driver support it.  If it does 
  754.  not work on your system, use F7 instead.) 
  755.  
  756.  Filename Completion Window Keys: 
  757.  
  758.         F7                  (from the command line)  Open the filename 
  759.                             completion window. 
  760.          or Ctrl-Tab 
  761.                            Scroll the display up one line. 
  762.                            Scroll the display down one line. 
  763.                            Scroll the display left 4 columns. 
  764.                            Scroll the display right 4 columns. 
  765.         PgUp                Scroll the display up one page. 
  766.         PgDn                Scroll the display down one page. 
  767.         Ctrl-PgUp           Go to the beginning of the filename list. 
  768.          or Home 
  769.         Ctrl-PgDn           Go to the end of the filename list. 
  770.          or End 
  771.         Enter               Insert the selected filename into the command line. 
  772.  
  773.  
  774. ΓòÉΓòÉΓòÉ 6.5. Directory History Window ΓòÉΓòÉΓòÉ
  775.  
  776. Directory History Window Keys: 
  777.  
  778.         Ctrl-PgUp       (from the command line) Open the directory history 
  779.                         window. 
  780.          or Ctrl-PgDn 
  781.                        Scroll the display up one line. 
  782.                        Scroll the display down one line. 
  783.                        Scroll the display left 4 columns. 
  784.                        Scroll the display right 4 columns. 
  785.         PgUp            Scroll the display up one page. 
  786.         PgDn            Scroll the display down one page. 
  787.         Ctrl-PgUp       Go to the beginning of the directory list. 
  788.          or Home 
  789.         Ctrl-PgDn       Go to the end of the directory list. 
  790.          or End 
  791.         Ctrl-D          Delete the selected line from the directory list. 
  792.         Enter           Change to the selected drive and directory. 
  793.         Ctrl-Enter      Move the selected line to the command line for editing. 
  794.  
  795.  Every time you change to a new directory or drive, the current directory is 
  796.  recorded in an internal directory history.  The length of the directory 
  797.  history is fixed at 256 bytes; as new entries are added, old entries are 
  798.  deleted from the list.  Directory changes are recorded whether you make them 
  799.  from the command line with the CD, CDD, PUSHD, or POPD commands, with an 
  800.  automatic directory change, or by typing a new drive letter followed by a 
  801.  colon. Directories are recorded whether you change from one to another at the 
  802.  command line, from within a batch file, or from within an alias.  In order to 
  803.  conserve space, each directory name is recorded just once in the directory 
  804.  history, even if you move into and out of that directory several times. 
  805.  
  806.  You can view the directory history from the scrollable directory history 
  807.  window and change to any drive and directory on the list. To activate the 
  808.  directory history window, press Ctrl-PgUp or Ctrl-PgDn at the command line. 
  809.  You can then select a new directory with the Enter key. 
  810.  
  811.  
  812. ΓòÉΓòÉΓòÉ 6.6. Automatic Directory Changes ΓòÉΓòÉΓòÉ
  813.  
  814. The automatic directory change feature gives you a quick method for changing 
  815. directories.  You can use an automatic directory change in place of the CD or 
  816. CDD command.  To do so, simply type the name of the directory you want to 
  817. change to at the prompt, with a backslash [\] at the end.  For example: 
  818.  
  819.         [c:\] 4os2\
  820.         [c:\4os2]
  821.  
  822. This feature can make directory changes very simple when it's combined with 
  823. CDPATH, a list of directories for the CD and CDD commands to search if the 
  824. directory you name does not exist below the current directory.  For example, 
  825. suppose CDPATH is set to C:\;D:\;E:\, and the directory WIN exists on drive E:. 
  826. You can change to this directory with a single word on the command line: 
  827.  
  828.         [c:\4os2] win\
  829.         [e:\win]
  830.  
  831. In executing the command shown above, 4OS2 first looks for a WIN subdirectory 
  832. of the current directory, i.e., C:\4OS2\WIN.  If no such directory exists it 
  833. looks for a WIN subdirectory in every directory in the CDPATH list, and changes 
  834. to the first one it finds. 
  835.  
  836. Internally, automatic directory changes use the CDD command, so the text before 
  837. the backslash can include a drive letter, a full path, or a partial path. 
  838. Commands like "....\" can be used to move up the directory tree quickly (see 
  839. Extended Parent Directory Names). Automatic directory changes save the current 
  840. directory, so it can be recalled with a "CDD -" or "CD -" command. 
  841.  
  842.  
  843. ΓòÉΓòÉΓòÉ 6.7. Multiple Commands ΓòÉΓòÉΓòÉ
  844.  
  845. You can type several commands on the same command line, separated by an 
  846. ampersand [&].  For example, if you know you want to copy all of your .TXT 
  847. files to drive A: and then run CHKDSK to be sure that drive A's file structure 
  848. is in good shape, you could enter the following command: 
  849.  
  850.         [c:\] copy *.txt a: & chkdsk a:
  851.  
  852. You may put as many commands on the command line as you wish, as long as the 
  853. total length of the command line does not exceed 1023 characters. 
  854.  
  855. You can use multiple commands in batch files and alias definitions as well as 
  856. from the command line. 
  857.  
  858. If you don't like using the default command separator, you can pick another 
  859. character using the SETDOS /C command or the CommandSep directive in the .INI 
  860. file.  If you plan to share aliases or batch files between 4DOS, 4OS2, and 
  861. 4DOS/NT, see 4DOS, 4OS2, and 4DOS/NT Compatibility for details about choosing 
  862. compatible command separators for two or more products. 
  863.  
  864.  
  865. ΓòÉΓòÉΓòÉ 6.8. Command-Line Length Limits ΓòÉΓòÉΓòÉ
  866.  
  867. When you first enter a command at the prompt or in an alias or batch file, it 
  868. can be up to 1,023 characters long. 
  869.  
  870. As 4OS2 scans the command line and substitutes the contents of aliases and 
  871. environment variables for their names, the line usually gets longer.  This 
  872. expanded line is stored in an internal buffer which allows each individual 
  873. command to grow to 1,023 characters during the expansion process.  In addition, 
  874. if you have multiple commands on a single line, during expansion the entire 
  875. line can grow to as much as 2,047 characters.  If your use of aliases or 
  876. environment variables causes the command line to exceed either of these limits 
  877. as it is expanded, you will see an error message and the remainder of the line 
  878. will not be executed. 
  879.  
  880.  
  881. ΓòÉΓòÉΓòÉ 6.9. Page and File Prompts ΓòÉΓòÉΓòÉ
  882.  
  883. Several 4OS2 commands can generate prompts, which wait for you to press a key 
  884. to view a new page or to perform a file activity. 
  885.  
  886. When 4OS2 is displaying information in page mode, for example with a DIR /P or 
  887. SET /P command, it displays the message 
  888.  
  889.         Press Esc to Quit or any other key to continue...
  890.  
  891. At this prompt, you can press Esc, Ctrl-C, or Ctrl- Break if you want to quit 
  892. the command.  You can press almost any other key to continue with the command 
  893. and see the next page of information. 
  894.  
  895. During file processing, if you have activated prompting with a command like DEL 
  896. /P, you will see this prompt before processing every file: 
  897.  
  898.         Y/N/R ?
  899.  
  900. You can answer this prompt by pressing "Y" for "Yes, process this file;"  "N" 
  901. for "No, do not process this file;"  or "R" for "process the Remainder of the 
  902. files without further prompting."  You can also press Ctrl-C or Ctrl-Break at 
  903. this prompt to cancel the remainder of the command. 
  904.  
  905.  
  906. ΓòÉΓòÉΓòÉ 6.10. Conditional Commands ΓòÉΓòÉΓòÉ
  907.  
  908. Conditional commands allow you to perform tasks based upon the previous 
  909. command's exit code.  Many programs return a 0 if they are successful and a 
  910. non-zero value if they encounter an error. 
  911.  
  912. If you separate two commands by && (AND), the second command will be executed 
  913. only if the first returns an exit code of 0.  For example, the following 
  914. command will only erase files if the BACKUP operation succeeds: 
  915.  
  916.         [c:\] backup c:\ a: && del c:\*.bak;*.lst
  917.  
  918. If you separate two commands by || (OR), the second command will be executed 
  919. only if the first returns a non-zero exit code. For example, if the following 
  920. BACKUP operation fails, then ECHO will display a message: 
  921.  
  922.         [c:\] backup c:\ a: || echo Error in the backup!
  923.  
  924. All internal commands return an exit code, but not all external programs do. 
  925. Conditional commands will behave unpredictably if you use them with external 
  926. programs which do not return an explicit exit code. 
  927.  
  928.  
  929. ΓòÉΓòÉΓòÉ 6.11. Command Grouping ΓòÉΓòÉΓòÉ
  930.  
  931. Command grouping allows you to logically group a set of commands together by 
  932. enclosing them in parentheses.  The parentheses are similar in function to the 
  933. BEGIN and END block statements in some programming languages. 
  934.  
  935. There are two primary uses for command grouping.  One is to execute multiple 
  936. commands in a place where normally only a single command is allowed.  For 
  937. example, suppose you want to copy then rename all the .WKQ files on drives A: 
  938. and B: using the FOR command.  You could do it like this: 
  939.  
  940.         [c:\] for %drv in (A B) do copy %drv:*.wkq d:\wksave\
  941.         [c:\] for %drv in (A B) do ren %drv:*.wkq *.old
  942.  
  943. But with command grouping you can do the same thing in one command (enter this 
  944. on one line): 
  945.  
  946.         [c:\] for %drv in (A B) do (copy %drv:*.wkq
  947.              d:\wksave\ & ren %drv:*.wkq *.sav)
  948.  
  949. The COPY and REN commands enclosed in the parentheses appear to FOR as if they 
  950. were a single command, so both commands are executed for every element of the 
  951. FOR list. 
  952.  
  953. You can also use command grouping to redirect input or output for several 
  954. commands without repeatedly using the redirection symbols.  For example, 
  955. consider the following batch file fragment which uses the ECHO command to 
  956. create a file (with >), and to append to the file (with >>): 
  957.  
  958.         echo Data files %_date > filelist
  959.         dir *.dat >> filelist
  960.         echo. >> filelist
  961.         echo Text files %_date >> filelist
  962.         dir *.txt >> filelist
  963.  
  964. Using command grouping, these commands can be written much more simply.  Enter 
  965. this example on one line: 
  966.  
  967.         (echo Data files %_date & dir *.dat & echo. & echo Text files
  968.         %_date & dir *.txt) > filelist
  969.  
  970. The redirection, which appears outside the parentheses, applies to all the 
  971. commands within the parentheses.  Because the redirection is performed only 
  972. once, the commands will run slightly faster than if each command was entered 
  973. separately.  The same approach can be used for input redirection and for 
  974. piping. 
  975.  
  976. You can also use command grouping in a batch file or at the prompt to split 
  977. commands over several lines.  This last example is like the redirection example 
  978. above, but is entered at the prompt.  4OS2 displays a "More?" prompt after each 
  979. incomplete line: 
  980.  
  981.         [c:\] (echo Data files %_date
  982.         More? dir *.dat
  983.         More? echo.
  984.         More? echo Text files %_date
  985.         More? dir *.txt) > filelist
  986.         [c:\]
  987.  
  988.  
  989. ΓòÉΓòÉΓòÉ 6.12. Escape Character ΓòÉΓòÉΓòÉ
  990.  
  991. 4OS2 recognizes a user-definable escape character.  This character gives the 
  992. following character a special meaning; it is not the same as the ASCII ESC that 
  993. is often used in ANSI and printer control sequences. 
  994.  
  995. The default escape character is a caret [^]. 
  996.  
  997. If you don't like using the default escape character, you can pick another 
  998. character using the SETDOS /E command or the EscapeChar directive in your .INI 
  999. file.  If you plan to share aliases or batch files between 4DOS, 4OS2, and 
  1000. 4DOS/NT, see 4DOS, 4OS2, and 4DOS/NT Compatibility for details about choosing 
  1001. compatible escape characters for two or more products. 
  1002.  
  1003. Eight special characters are recognized when they are preceded by the escape 
  1004. character.  The combination of the escape character and one of these characters 
  1005. is translated to a single character, as shown below.  These are useful for 
  1006. redirecting codes to the printer; ^e is also useful to generate ANSI "escape 
  1007. sequences" in your PROMPT, ECHO, or other output commands; and ^r can be used 
  1008. in keystroke aliases.  The special characters which can follow the escape 
  1009. character are: 
  1010.  
  1011.         b   backspace 
  1012.         c   comma 
  1013.         e   the ASCII ESC character (ASCII 27) 
  1014.         f   form feed 
  1015.         n   line feed 
  1016.         r   carriage return 
  1017.         s   space 
  1018.         t   tab character 
  1019.  
  1020.  If you follow the escape character with any other character, the escape 
  1021.  character is removed and the second character is copied directly to the 
  1022.  command line.  This allows you to suppress the normal meaning of special 
  1023.  characters (such as ? * / \ | " ` > < and &). 
  1024.  
  1025.  For example, to send a form feed followed by the sequence ESC Y to the 
  1026.  printer, you can use this command: 
  1027.  
  1028.           [c:\] echos ^f^eY > prn
  1029.  
  1030.  
  1031. ΓòÉΓòÉΓòÉ 6.13. Critical Errors ΓòÉΓòÉΓòÉ
  1032.  
  1033. OS/2 watches for physical errors during input and output operations.  Physical 
  1034. errors are those due to hardware problems, such as trying to read a floppy disk 
  1035. while the drive door is open. 
  1036.  
  1037. These errors are called critical errors because OS/2, 4OS2, or your application 
  1038. program cannot proceed until the error is resolved. 
  1039.  
  1040. When a critical error occurs, you will see a popup window asking you to choose 
  1041. an error handling option.  The message comes from OS/2, and will typically 
  1042. offer you four choices: 
  1043.  
  1044.         Return error code to program.  Tell the program that the operation 
  1045.         failed.  This option returns an error code to 4OS2 or to the 
  1046.         application program that was running when the error occurred.  4OS2 
  1047.         generally stops the current command when an operation fails. 
  1048.  
  1049.         End program/command/operation.  Choose this option to stop the program 
  1050.         that was running when the error occurred.  Choosing this option after 
  1051.         an error in the 16-bit version of 4OS2 will abort the command, but not 
  1052.         4OS2 itself.  Choosing it after an error in the 32-bit version of 4OS2 
  1053.         will abort both the command and 4OS2. 
  1054.  
  1055.         Retry command or operation.  Choose this option if you have corrected 
  1056.         the problem. 
  1057.  
  1058.         Display help.  Display further information on the error. 
  1059.  
  1060.  
  1061. ΓòÉΓòÉΓòÉ 7. Redirection and Piping ΓòÉΓòÉΓòÉ
  1062.  
  1063. This section covers redirection and piping.  You can use these features to 
  1064. change how 4OS2 and some application programs handle input and output. 
  1065.  
  1066. Internal commands and many external programs get their input from the 
  1067. computer's standard input device and send their output to the standard output 
  1068. device.  Some programs also send special messages to the standard error device. 
  1069. Normally, the keyboard is used for standard input and the video screen for both 
  1070. standard output and standard error.  Redirection and piping allow you to change 
  1071. these assignments temporarily. 
  1072.  
  1073. Redirection 
  1074.  
  1075. Redirection assigns standard input, standard output, and standard error to a 
  1076. device like the printer or serial port, or to a file. 
  1077.  
  1078. Redirection always applies to a specific command, and lasts only for the 
  1079. duration of that command.  When the command is finished, the assignments for 
  1080. standard input, standard output, and standard error revert to whatever they 
  1081. were before the command. 
  1082.  
  1083. Here are the standard redirection options supported by 4OS2 (see below for 
  1084. additional redirection options using numeric file handles): 
  1085.  
  1086.         < filename          To get input from a file or device instead of from 
  1087.                             the keyboard 
  1088.         > filename          Redirect standard output to a file or device 
  1089.         >& filename         Redirect standard output and standard error to a 
  1090.                             file or device 
  1091.         >&> filename        Redirect standard error only to a file or device 
  1092.  
  1093.  To use redirection, place the redirection symbol and filename at the end of 
  1094.  the command line, after the command name and any parameters.  For example, to 
  1095.  redirect the output of the DIR command to a file called DIRLIST, you could use 
  1096.  a command line like this: 
  1097.  
  1098.           [c:\] dir /b *.dat > dirlist
  1099.  
  1100.  You can use both input and output redirection for the same command, if both 
  1101.  are appropriate: 
  1102.  
  1103.           [c:\] sort < dirlist > dirlist.srt
  1104.  
  1105.  If you redirect the output of a single internal command like DIR, the 
  1106.  redirection ends automatically when that command is done.  If you start a 
  1107.  batch file with redirection, all of the batch file's output is redirected, and 
  1108.  redirection ends when the batch file is done.  Similarly, if you use 
  1109.  redirection at the end of a command group, all of the output from the command 
  1110.  group is redirected, and redirection ends when the command group is done. 
  1111.  
  1112.  If you want to append output to the end of an existing file, rather than 
  1113.  creating a new file, replace the first ">" in the output redirection symbol 
  1114.  with ">>" (use >>, >>&, and >>&>). 
  1115.  
  1116.  When output is directed to a file with >, >&, or >&>, if the file already 
  1117.  exists, it will be overwritten.  You can protect existing files by using the 
  1118.  SETDOS /N1 command or the NoClobber directive in the .INI file. 
  1119.  
  1120.  When output is appended to a file with >>, >>&, or >>&>, the file will be 
  1121.  created if it doesn't already exist. Setting NoClobber will also prevent the 
  1122.  creation of a new file. 
  1123.  
  1124.  You can temporarily override the current setting of NoClobber by using an 
  1125.  exclamation mark [!] after the redirection symbol. For example, to redirect 
  1126.  the output of DIR to the file DIROUT, and allow overwriting of any existing 
  1127.  file despite the NoClobber setting: 
  1128.  
  1129.           [c:\] dir >! dirout
  1130.  
  1131.  Redirection is fully nestable.  For example, you can invoke a batch file and 
  1132.  redirect all of its output to a file or device.  Output redirection on a 
  1133.  command within the batch file will take effect for that command only; when the 
  1134.  command is completed, output will revert to the redirected output file or 
  1135.  device in use for the batch file as a whole. 
  1136.  
  1137.  You can use redirection if you need to create a zero-byte file.  To do so, 
  1138.  enter  >filename as a command, with no actual command before the > character. 
  1139.  
  1140.  In addition to the standard redirection options, 4OS2 also supports the OS/2 
  1141.  CMD.EXE syntax: 
  1142.  
  1143.         n>file      Redirect handle n to the named file 
  1144.         n>&m        Redirect handle n to the same place as handle m 
  1145.  
  1146.  [n] and [m] are one-digit file handles between 0 and 9.  You may not put any 
  1147.  spaces between the n and the >, or between the >, &, and m in the second form. 
  1148.  OS/2 interprets "0" as standard input, "1" as standard output, and "2" as 
  1149.  standard error.  Handles 3 to 9 will probably not be useful unless you have an 
  1150.  application which uses those handles for a specific, documented purpose, or 
  1151.  have opened a file with the %@FILEOPEN variable function and the file handle 
  1152.  is between 3 and 9. 
  1153.  
  1154.  Piping 
  1155.  
  1156.  You can create a "pipe" to send the standard output of one command to the 
  1157.  standard input of another command: 
  1158.  
  1159.         command1 | command2             Send the standard output of command1 to 
  1160.                                         the standard input of command2 
  1161.         command1 |& command2            Send the standard output and standard 
  1162.                                         error of command1 to the standard input 
  1163.                                         of command2 
  1164.  
  1165.  For example, to take the output of the SET command (which displays a list of 
  1166.  your environment variables and their values) and pipe it to the SORT utility 
  1167.  to generate a sorted list, you would use the command: 
  1168.  
  1169.           [c:\] set | sort
  1170.  
  1171.  To do the same thing and then pipe the sorted list to the internal LIST 
  1172.  command for full-screen viewing: 
  1173.  
  1174.           [c:\] set | sort | list /s
  1175.  
  1176.  The TEE and Y commands are "pipe fittings" which add more flexibility to 
  1177.  pipes. 
  1178.  
  1179.  Like redirection, pipes are fully nestable.  For example, you can invoke a 
  1180.  batch file and send all of its output to another command with a pipe.  A pipe 
  1181.  on a command within the batch file will take effect for that command only; 
  1182.  when the command is completed, output will revert to the pipe in use for the 
  1183.  batch file as a whole. 
  1184.  
  1185.  4OS2 implements pipes by starting a new process for the receiving program 
  1186.  instead of using temporary files.  The sending and receiving programs run 
  1187.  simultaneously; the sending program writes to the pipe and the receiving 
  1188.  program reads from the pipe.  When the receiving program finishes reading and 
  1189.  processing the piped data, it is ended automatically. 
  1190.  
  1191.  When you use pipes with 4OS2 make sure you think about any possible 
  1192.  consequences that can occur from using a separate process to run the receiving 
  1193.  program. 
  1194.  
  1195.  
  1196. ΓòÉΓòÉΓòÉ 8. File Selection ΓòÉΓòÉΓòÉ
  1197.  
  1198. Most internal commands (like COPY, DIR, etc.) work on a file or a group of 
  1199. files.  Besides typing the exact name of the file you want to work with, you 
  1200. can use several shorthand forms for naming or selecting files. 
  1201.  
  1202. The features explained in this section apply to 4OS2 commands only, and 
  1203. generally can not be used to pass file names to external programs unless those 
  1204. programs were specifically written to support these features. 
  1205.  
  1206. The file selection features are: 
  1207.  
  1208.             Extended Parent Directory Names 
  1209.             Wildcards 
  1210.             Date, Time, and Size Ranges 
  1211.             Multiple Filenames 
  1212.             Include Lists 
  1213.             Executable Extensions 
  1214.  
  1215.  
  1216. ΓòÉΓòÉΓòÉ 8.1. Extended Parent Directory Names ΓòÉΓòÉΓòÉ
  1217.  
  1218. 4OS2 allows you to extend the traditional syntax for naming the parent 
  1219. directory, by adding additional [.] characters.  Each additional [.] represents 
  1220. an additional directory level above the current directory.  For example, 
  1221. .\FILE.DAT refers to a file in the current directory, ..\FILE.DAT refers to a 
  1222. file one level up (in the parent directory), and ...\FILE.DAT refers to a file 
  1223. two levels up (in the parent of the parent directory).  If you are in the 
  1224. C:\DATA\FINANCE\JANUARY directory and want to copy the file LETTERS.DAT from 
  1225. the directory C:\DATA to drive A: 
  1226.  
  1227.         [C:\DATA\FINANCE\JANUARY] copy ...\LETTERS.DAT A:
  1228.  
  1229.  
  1230. ΓòÉΓòÉΓòÉ 8.2. Wildcards ΓòÉΓòÉΓòÉ
  1231.  
  1232. Wildcards let you specify a file or group of files by typing a partial 
  1233. filename.  The appropriate directory is scanned to find all of the files that 
  1234. match the partial name you have specified. 
  1235.  
  1236. There are two wildcard characters, the asterisk [*] and the question mark [?], 
  1237. plus a special method of specifying a range of permissible characters. 
  1238.  
  1239. An asterisk [*] in a filename means "any zero or more characters in this 
  1240. position."  For example, this command will display a list of all files in the 
  1241. current directory: 
  1242.  
  1243.         [c:\] dir *.*
  1244.  
  1245. If you want to see all of the files with a .TXT extension, you could type this: 
  1246.  
  1247.         [c:\] dir *.txt
  1248.  
  1249. If you know that the file you are looking for has a base name that begins with 
  1250. ST and an extension that begins with .D, you can find it this way.  Filenames 
  1251. such as STATE.DAT, STEVEN.DOC, and ST.D will all be displayed: 
  1252.  
  1253.         [c:\] dir st*.d*
  1254.  
  1255. With 4OS2, you can also use the asterisk to match filenames with specific 
  1256. letters somewhere inside the name.  The following example will display any file 
  1257. with a .TXT extension that has the letters AM together anywhere inside its base 
  1258. name.  It will, for example, display AMPLE.TXT, STAMP.TXT, CLAM.TXT, and AM.TXT 
  1259.  
  1260.         [c:\] dir *am*.txt
  1261.  
  1262. A question mark [?] matches any single filename character.  You can put the 
  1263. question mark anywhere in a filename and use as many question marks as you 
  1264. need.  The following example will display files with names like LETTER.DOC and 
  1265. LATTER.DAT, and LITTER.DU : 
  1266.  
  1267.         [c:\] dir l?tter.d??
  1268.  
  1269. The use of an asterisk wildcard before other characters, and of the character 
  1270. ranges discussed below, are enhancements to the standard wildcard syntax, and 
  1271. are not likely to work properly with software other than 4OS2. 
  1272.  
  1273. "Extra" question marks in your wildcard specification are ignored if the file 
  1274. name is shorter than the wildcard specification.  For example, if you have 
  1275. files called LETTER.DOC, LETTER1.DOC, and LETTERA.DOC, this command will 
  1276. display all three names: 
  1277.  
  1278.         [c:\] dir letter?.doc
  1279.  
  1280. The file LETTER.DOC is included in the display because the "extra" question 
  1281. mark at the end of "LETTER? " is ignored when matching the shorter name LETTER. 
  1282.  
  1283. In some cases, the question mark wildcard may be too general.  You can also 
  1284. specify what characters you want to accept (or exclude) in a particular 
  1285. position in the filename by using square brackets. Inside the brackets, you can 
  1286. put the individual acceptable characters or ranges of characters.  For example, 
  1287. if you wanted to match LETTER0.DOC through LETTER9.DOC, you could use this 
  1288. command: 
  1289.  
  1290.         [c:\] dir letter[0-9].doc
  1291.  
  1292. You could find all files that have a vowel as the second letter in their name 
  1293. this way.  This example also demonstrates how to mix the wildcard characters: 
  1294.  
  1295.         [c:\] dir ?[aeiouy]*.*
  1296.  
  1297. You can exclude a group of characters or a range of characters by using an 
  1298. exclamation mark [!] as the first character inside the brackets.  This example 
  1299. displays all filenames that are at least 2 characters long except those which 
  1300. have a vowel as the second letter in their names: 
  1301.  
  1302.         [c:\] dir ?[!aeiouy]*.*
  1303.  
  1304. The next example, which selects files such as AIP, BIP, and TIP but not NIP, 
  1305. demonstrates how you can use multiple ranges inside the brackets.  It will 
  1306. accept a file that begins with an A, B, C, D, T, U, or V: 
  1307.  
  1308.         [c:\] dir [a-dt-v]ip
  1309.  
  1310. You may use a question mark character inside the brackets, but its meaning is 
  1311. slightly different than a normal (unbracketed) question mark wildcard.  A 
  1312. normal question mark wildcard matches any character, but will be ignored when 
  1313. matching a name shorter than the wildcard specification, as described above.  A 
  1314. question mark inside brackets will match any character, but will not be 
  1315. discarded when matching shorter filenames.  For example: 
  1316.  
  1317.         [c:\] dir letter[?].doc
  1318.  
  1319. will display LETTER1.DOC and LETTERA.DOC, but not LETTER.DOC. 
  1320.  
  1321. You can repeat any of the wildcard characters in any combination you desire 
  1322. within a single file name.  For example, the following command lists all files 
  1323. which have an A, B, or C as the third character, followed by zero or more 
  1324. additional characters, followed by a D, E, or F, followed optionally by some 
  1325. additional characters, and with an extension beginning with P or Q.  You 
  1326. probably won't need to do anything this complex, but we've included it to show 
  1327. you the flexibility of extended wildcards: 
  1328.  
  1329.         [c:\] dir ??[abc]*[def]*.[pq]*
  1330.  
  1331. You can also use the square bracket wildcard syntax to work around a conflict 
  1332. between HPFS filenames containing semicolons [;], and the use of a semicolon to 
  1333. indicate an include list. For example, if you have a file on an HPFS drive 
  1334. named C:\DATA\LETTER1;V2 and you enter this command: 
  1335.  
  1336.         [c:\] del \data\letter1;v2
  1337.  
  1338. you will not get the results you expect.  Instead of deleting the named file, 
  1339. 4OS2 will attempt to delete LETTER1 and then V2, because the semicolon 
  1340. indicates an include list.  However if you use square brackets around the 
  1341. semicolon it will be interpreted as a filename character, and not as an include 
  1342. list separator.  For example, this command would delete C:\DATA\LETTER1;V2 : 
  1343.  
  1344.         [c:\] del \data\letter1[;]v2
  1345.  
  1346.  
  1347. ΓòÉΓòÉΓòÉ 8.3. Date, Time, and Size Ranges ΓòÉΓòÉΓòÉ
  1348.  
  1349. Most internal commands which accept wild cards also allow date, time, and size 
  1350. ranges to further define the files that you wish to work with.  4OS2 will 
  1351. examine the files' timestamps (which record when the file was last modified), 
  1352. and the files' sizes, to determine which files meet the range criteria that you 
  1353. specify. 
  1354.  
  1355. A range begins with the switch character (/), followed by a left square bracket 
  1356. ("[") and a character that specifies the range type:  "s" for a size range, "d" 
  1357. for a date range, or "t" for a time range.  The "s", "d", or "t" is followed by 
  1358. a start value, and an optional comma and end value.  The range ends with a 
  1359. right square bracket ("]"). 
  1360.  
  1361. See the individual range types for details on specifying ranges: 
  1362.  
  1363.             Size Ranges 
  1364.             Date Ranges 
  1365.             Time Ranges 
  1366.  
  1367.  Using Ranges 
  1368.  
  1369.  If you combine two types of ranges, a file must satisfy both ranges to be 
  1370.  included.  For example, /[d2-8-94,2-9-94] /[s1024,2048] means files last 
  1371.  modified between February 8 and February 9, 1994, which are also between 1,024 
  1372.  and 2,048 bytes long. 
  1373.  
  1374.  When you use a date, time, or size range in a command, it should immediately 
  1375.  follow the command name.  Unlike some command switches which apply to only 
  1376.  part of the command line, the range usually applies to all file names 
  1377.  specified for the command.  Any exceptions are noted in the descriptions of 
  1378.  individual commands. 
  1379.  
  1380.  For example, to get a directory of all the *.C files dated October 1, 1993, 
  1381.  you could use this command: 
  1382.  
  1383.           [c:\] dir /[d10-1-93,+0] *.c
  1384.  
  1385.  To delete all of the 0-byte files on your hard disk, you could use this 
  1386.  command: 
  1387.  
  1388.           [c:\] del /[s0,0] *.* /s
  1389.  
  1390.  And to copy all of the non-zero byte files that you changed yesterday or today 
  1391.  to your floppy disk, you can use this command: 
  1392.  
  1393.           [c:\] copy /[d-1] /[s1] *.* a:
  1394.  
  1395.  Date, time, and size ranges can be used with the ATTRIB, COPY, DEL, DESCRIBE, 
  1396.  DIR, EXCEPT, FOR, LIST, MOVE, RD, REN, SELECT, and TYPE commands. They cannot 
  1397.  be used with filename completion or in filename arguments for variable 
  1398.  functions. 
  1399.  
  1400.  
  1401. ΓòÉΓòÉΓòÉ 8.3.1. Size Ranges ΓòÉΓòÉΓòÉ
  1402.  
  1403. Size ranges simply select files whose size is between the limits given.  For 
  1404. example, /[s10000,20000] selects files between 10,000 and 20,000 bytes long. 
  1405.  
  1406. Either or both values in a size range can end with "k" to indicate thousands of 
  1407. bytes, "K" to indicate kilobytes (1,024 bytes), "m" to indicate millions of 
  1408. bytes, or "M" to indicate megabytes (1,048,576 bytes).  For example, the range 
  1409. above could be rewritten as /[s10k,20k]. 
  1410.  
  1411. All ranges are inclusive.  Both examples above will match files that are 
  1412. exactly 10,000 bytes and 20,000 bytes long, as well as all sizes in between. 
  1413.  
  1414. The second argument of a size range is optional.  If you use a single argument, 
  1415. like /[s10k], you will select files of that size or larger.  You can also 
  1416. precede the second argument with a plus sign [+]; when you do, it is added to 
  1417. the first value to determine the largest file size to include in the search. 
  1418. For example,  /[s10k,+1k] select files from 10,000 through 11,000 bytes in 
  1419. size. 
  1420.  
  1421. Some further examples of size ranges: 
  1422.  
  1423.         Specification       Selects Files
  1424.  
  1425.         /[s0,0]             of length zero (empty)
  1426.         /[s1M]              1 megabyte or more in length
  1427.         /[s10k,+200]        between 10,000 and 10,200 bytes
  1428.  
  1429.  
  1430. ΓòÉΓòÉΓòÉ 8.3.2. Date Ranges ΓòÉΓòÉΓòÉ
  1431.  
  1432. Date ranges select files that were created or last modified at any time between 
  1433. the two dates.  For example, /[d12-1-93,12-5-93] selects files that were last 
  1434. modified between December 1, 1993, and December 5, 1993. 
  1435.  
  1436. The time for the starting date defaults to 00:00:00 and the time for the ending 
  1437. date defaults to 23:59:59.  You can alter these defaults, if you wish, by 
  1438. including a start and stop time inside the date range.  The time is separated 
  1439. from the date with an at sign [@].  For example, the range 
  1440. /[d7-1-94@8:00a,7-3-94@6:00p] selects files that were modified at any time 
  1441. between 8:00 am on July 1, 1994 and 6:00 pm on July 3, 1994.  If you prefer, 
  1442. you can specify the times in 24-hour format (e.g., @18:00 for the end time in 
  1443. the previous example). 
  1444.  
  1445. If you omit the second argument in a date range, 4OS2 substitutes the current 
  1446. date and time.  For example, /[d10-1-93] selects files dated between October 1, 
  1447. 1993 and today. 
  1448.  
  1449. You can use an offset value for either the beginning or ending date, or both. 
  1450. An offset begins with a plus sign [+] or a minus sign [-] followed by an 
  1451. integer.  If you use an offset for the second value, it is calculated relative 
  1452. to the first.  If you use an offset for the first (or only) value, the current 
  1453. date is used as the basis for calculation.  For example: 
  1454.  
  1455.         Specification       Selects Files
  1456.  
  1457.         /[d10-27-93,+3]     modified between 10-27-93 and 10-30-93
  1458.         /[d10-27-93,-3]     modified between 10-24-93 and 10-27-93
  1459.         /[d-0]              modified today (from today minus zero days, to today)
  1460.         /[d-1]              modified yesterday or today (from today minus one day,
  1461.                             to today)
  1462.         /[d-1,+0]           modified yesterday (from today minus one day, to zero
  1463.                             days after that)
  1464.  
  1465. You cannot use offsets in the time portion of a date range (the part after an 
  1466. at sign), but you can combine a time with a date offset.  For example, 
  1467. /[d12-8-93@12:00,+2@12:00] selects files that were last modified between noon 
  1468. on December 8 and noon on December 10, 1993.  Similarly, /[d-2@15:00,+1] 
  1469. selects files last modified between 3:00 pm the day before yesterday and the 
  1470. end of the day one day after that, i.e., yesterday.  The second time defaults 
  1471. to the end of the day because no time is given. 
  1472.  
  1473.  
  1474. ΓòÉΓòÉΓòÉ 8.3.3. Time Ranges ΓòÉΓòÉΓòÉ
  1475.  
  1476. A time range specifies a file modification time without reference to the date. 
  1477. For example, to select files modified between noon and 2:00 pm on any date, use 
  1478. /[t12:00p,2:00p].  The times in a time range can either be in 12-hour format, 
  1479. with a trailing "a" for AM or "p" for PM, or in 24-hour format. 
  1480.  
  1481. If you omit the second argument in a time range, you will select files that 
  1482. were modified between the first time and the current time, on any date.  You 
  1483. can also use offsets, beginning with a plus sign [+] or a minus sign [-] for 
  1484. either or both of the arguments in a time range.  The offset values are 
  1485. interpreted as minutes.  Some examples: 
  1486.  
  1487.         Specification       Selects Files
  1488.  
  1489.         /[t12:00p,+120]     modified between noon and 2:00 PM on any date
  1490.         /[t-120,+120]       modified between two hours ago and the
  1491.                             current time on any date
  1492.         /[t0:00,11:59]      modified in the morning on any date
  1493.  
  1494.  
  1495. ΓòÉΓòÉΓòÉ 8.4. Multiple Filenames ΓòÉΓòÉΓòÉ
  1496.  
  1497. Most file processing commands can work with multiple files at one time.  To use 
  1498. multiple file names, you simply list the files one after another on the command 
  1499. line, separated by spaces.  You can use wildcards in any or all of the 
  1500. filenames.  For example, to copy all .TXT and .DOC files from the current 
  1501. directory to drive A, you could use this command: 
  1502.  
  1503.         [c:\] copy *.txt *.doc a:
  1504.  
  1505. If the files you want to work with are not in the default directory, you must 
  1506. include the full path with each filename: 
  1507.  
  1508.         [c:\] copy a:\details\file1.txt a:\details\file1.doc c:
  1509.  
  1510. Multiple filenames are handy when you want to match a group of files which 
  1511. cannot be defined with a single filename and wildcards.  They let you be very 
  1512. specific about which files you want to work with in a command. 
  1513.  
  1514. When you use multiple filenames with a command that expects both a source and a 
  1515. destination, like COPY or MOVE, be sure that you always include a specific 
  1516. destination on the command line.  If you don't, the command will assume that 
  1517. the last filename is the destination and may overwrite important files. 
  1518.  
  1519. Like extended wildcards and include lists, the multiple filename feature will 
  1520. work with internal commands but not with external programs, unless those 
  1521. programs have been written to handle multiple file names on the command line. 
  1522.  
  1523. If you have a list of files to process that's too long to put on the command 
  1524. line or too time-consuming to type, see the SELECT command for another way of 
  1525. passing multiple file names to a command. 
  1526.  
  1527.  
  1528. ΓòÉΓòÉΓòÉ 8.5. Include Lists ΓòÉΓòÉΓòÉ
  1529.  
  1530. Any internal command that accepts multiple filenames will also accept one or 
  1531. more include lists.  An include list is simply a group of filenames, with or 
  1532. without wildcards, separated by semicolons [;].  All files in the include list 
  1533. must be in the same directory.  You may not add a space on either side of the 
  1534. semicolon. 
  1535.  
  1536. For example, you can shorten this command which uses multiple file names: 
  1537.  
  1538.         c:\> copy a:\details\file1.txt a:\details\file1.doc c:
  1539.  
  1540. to this using an include list: 
  1541.  
  1542.         c:\> copy a:\details\file1.txt;file1.doc c:
  1543.  
  1544. Multiple filenames and include lists are processed differently by the DIR and 
  1545. SELECT commands. If you use multiple filenames, all of the files matching the 
  1546. first filename are processed, then all of the files matching the second name, 
  1547. and so on.  When you use an include list, all files that match any entry in the 
  1548. include list are processed together, and will appear together in the directory 
  1549. display or SELECT list.  You can see this difference clearly if you experiment 
  1550. with both techniques and the DIR command.  For example, 
  1551.  
  1552.         [c:\] dir *.txt *.doc
  1553.  
  1554. will list all the .TXT files with a directory header, the file list, and a 
  1555. summary of the total number of files and bytes used.  Then it will do the same 
  1556. for the .DOC files.  However, 
  1557.  
  1558.         [c:\] dir *.txt;*.doc
  1559.  
  1560. will display all the files in one list. 
  1561.  
  1562. Like extended wildcards and multiple filenames, the include list feature will 
  1563. work with internal commands, but not with external programs (unless they have 
  1564. been programmed especially to support it). 
  1565.  
  1566.  
  1567. ΓòÉΓòÉΓòÉ 8.6. Executable Extensions ΓòÉΓòÉΓòÉ
  1568.  
  1569.  The syntax for creating an executable extension is: 
  1570.  
  1571.         set .ext=command [options]
  1572.  
  1573. This tells 4OS2 to run the specified command whenever you name a file with the 
  1574. extension .ext at the prompt. 
  1575.  
  1576. .EXT is the executable file extension; command is the name of the internal 
  1577. command, external program, alias, or batch file to run; and [options] are any 
  1578. command-line startup options you want to specify for the program, batch file, 
  1579. or alias. 
  1580.  
  1581. Normally, when you type a filename (as opposed to an alias or internal command 
  1582. name) as the first word on the command line, 4OS2 looks for a file with that 
  1583. name to execute.  The file's extension may be .EXE or .COM to indicate that it 
  1584. contains a program, it may have a batch file extension like .BTM, or the file's 
  1585. contents may indicate that it is executable. 
  1586.  
  1587. You can add to this default list of extensions, and have 4OS2 take the action 
  1588. you want with files that are not executable programs or batch files.  The 
  1589. action taken is always based on the file's extension.  For example, you could 
  1590. start your text editor whenever you type the name of a .DOC file, or start your 
  1591. database manager whenever you type the name of a .DAT file. 
  1592.  
  1593. Environment variables define the internal command, external program, batch 
  1594. file, or alias to run for each defined file extension.  To create an executable 
  1595. extension, use the SET command to create a new environment variable.  An 
  1596. environment variable is recognized as an executable extension if its name 
  1597. begins with a period. 
  1598.  
  1599. For example, if you want to run a word processor called EDITOR whenever you 
  1600. type the name of a file that has an extension of .EDT, you could use this 
  1601. command: 
  1602.  
  1603.         [c:\] set .edt=c:\edit\editor.exe
  1604.  
  1605. If the command specified in an executable extension is a batch file or external 
  1606. program, 4OS2 will search the PATH for it if necessary.  However, you can make 
  1607. sure that the correct program or batch file is used, and speed up the 
  1608. executable extension, by specifying the full name including drive, path, 
  1609. filename, and extension. 
  1610.  
  1611. Once an executable extension is defined, any time you name a file with that 
  1612. extension the corresponding program, batch file, or alias is started, with the 
  1613. name of your file passed to it as a parameter. 
  1614.  
  1615. The following example defines QBASIC.EXE as the processor for .BAS files: 
  1616.  
  1617.         [c:\] set .bas=c:\dos\qbasic.exe /run
  1618.  
  1619. With this definition, if you have a file named PUSHCART.BAS in the current 
  1620. directory and enter the command: 
  1621.  
  1622.         [c:\] pushcart
  1623.  
  1624. 4OS2 will execute the command: 
  1625.  
  1626.         c:\dos\qbasic.exe /run pushcart.bas
  1627.  
  1628. The next example defines B.EXE (the Brief text editor) as the processor for .C 
  1629. files: 
  1630.  
  1631.         [c:\] set .c=c:\brief\b.exe -Mxyz
  1632.  
  1633. Now, if you have a file called HELLO.C and enter the command 
  1634.  
  1635.         [c:\] hello -i30
  1636.  
  1637. This will be expanded to: 
  1638.  
  1639.         c:\brief\b.exe -Mxyz hello.c -i30
  1640.  
  1641. Notice that the text from the .C environment variable is inserted at the 
  1642. beginning of the line, including any options, followed by the original file 
  1643. name plus its extension, and then the remainder of the original command line. 
  1644.  
  1645. In order for executable extensions to work, the command, program, batch file, 
  1646. or alias must be able to interpret the command line properly.  For example, if 
  1647. a program you want to run doesn't accept a file name on its command line as 
  1648. shown in these examples, then executable extensions won't work with that 
  1649. program. 
  1650.  
  1651. Executable extensions may include wildcards, so you could, for example, run 
  1652. your text editor for any file with an extension beginning with T by defining an 
  1653. executable extension called .T*.  Extended wildcards (e.g., DO[CT] for .DOC and 
  1654. .DOT files) may also be used. 
  1655.  
  1656.  
  1657. ΓòÉΓòÉΓòÉ 9. Batch Files ΓòÉΓòÉΓòÉ
  1658.  
  1659. A batch file is a file that contains a list of commands to execute.  4OS2 reads 
  1660. and interprets each line as if it had been typed at the keyboard.  Like 
  1661. aliases, batch files are handy for automating computing tasks.  Unlike aliases, 
  1662. batch files can be as long as you wish.  Batch files take up separate disk 
  1663. space for each file, and can't usually execute quite as quickly as aliases, 
  1664. since they must be read from the disk. 
  1665.  
  1666. The topics included in this section are: 
  1667.  
  1668.             .BAT, .CMD, and .BTM Files 
  1669.             Echoing in Batch Files 
  1670.             Batch File Parameters 
  1671.             Automatic Batch Files 
  1672.             Detecting 4OS2 
  1673.             Batch File Compression 
  1674.             Argument Quoting 
  1675.             4DOS, 4OS2, and 4DOS/NT Compatibility 
  1676.             REXX Support 
  1677.             EXTPROC Support 
  1678.  
  1679.  
  1680. ΓòÉΓòÉΓòÉ 9.1. .BAT, .CMD, and .BTM Files ΓòÉΓòÉΓòÉ
  1681.  
  1682. A batch file can run in two different modes.  In the first, traditional mode, 
  1683. each line of the batch file is read and executed individually.  In the second 
  1684. mode, the entire batch file is read into memory at once.  The second mode can 
  1685. be 5 to 10 times faster, especially if most of the commands in the batch file 
  1686. are internal commands.  However, only the first mode can be used for 
  1687. self-modifying batch files (which are rare), and for batch files larger than 
  1688. 64K bytes. 
  1689.  
  1690. The batch file's extension determines its mode.  Files with a .CMD extension 
  1691. are run in the slower, traditional mode.  Files with a .BTM extension are run 
  1692. in the faster, more efficient mode.  You can change the execution mode inside a 
  1693. batch file with the LOADBTM command. 
  1694.  
  1695.  
  1696. ΓòÉΓòÉΓòÉ 9.2. Echoing in Batch Files ΓòÉΓòÉΓòÉ
  1697.  
  1698. By default, each line in a batch file is displayed or "echoed" as it is 
  1699. executed.  You can change this behavior, if you want, in several different 
  1700. ways: 
  1701.  
  1702.         Any batch file line that begins with an [@] symbol will not be 
  1703.         displayed. 
  1704.  
  1705.         The display can be turned off and on within a batch file with the ECHO 
  1706.         OFF and ECHO ON commands. 
  1707.  
  1708.         The default setting can be changed with the SETDOS /V command or the 
  1709.         BatchEcho directive in the .INI file. 
  1710.  
  1711.  For example, the following line turns off echoing inside a batch file.  The 
  1712.  [@] symbol keeps the batch file from displaying the ECHO OFF command: 
  1713.  
  1714.           @echo off
  1715.  
  1716.  4OS2 also has a command line echo that is unrelated to the batch file echo 
  1717.  setting.  See ECHO for details about both settings. 
  1718.  
  1719.  
  1720. ΓòÉΓòÉΓòÉ 9.3. Batch File Parameters ΓòÉΓòÉΓòÉ
  1721.  
  1722. Like aliases and application programs, batch files can examine the command line 
  1723. that is used to invoke them.  The command tail (everything on the command line 
  1724. after the batch file name) is separated into individual parameters (also called 
  1725. arguments or batch variables) by scanning for the spaces, tabs, and commas that 
  1726. separate the parameters.  A batch file can work with the individual parameters 
  1727. or with the command tail as a whole. 
  1728.  
  1729. These parameters are numbered from %1 to %127.  %1 refers to the first 
  1730. parameter on the command line, %2 to the second, and so on.  It is up to the 
  1731. batch file to determine the meaning of each parameter.  You can use quotation 
  1732. marks to pass spaces, tabs, commas, and other special characters in a batch 
  1733. file parameter; see Argument Quoting for details. 
  1734.  
  1735. Parameters that are referred to in a batch file, but which are missing on the 
  1736. command line, appear as empty strings inside the batch file.  For example, if 
  1737. you start a batch file and put two parameters on the command line, any 
  1738. reference in the batch file to %3, or any higher-numbered parameter, will be 
  1739. interpreted as an empty string. 
  1740.  
  1741. A batch file can also work with three special parameters:  %0 contains the name 
  1742. of the batch file as it was entered on the command line, %# contains the number 
  1743. of command line arguments, and %n$ contains the complete command-line tail 
  1744. starting with argument number "n" (for example, %3$ means the third parameter 
  1745. and all those after it).  The default value of "n" is 1, so %$ contains the 
  1746. entire command tail.  The values of these special parameters will change if you 
  1747. use the SHIFT command. 
  1748.  
  1749. By default, 4DOS uses an ampersand [&] instead of a dollar sign [$] to indicate 
  1750. the remainder of the command tail.  For example, %& means all the parameters, 
  1751. and %2& means the second parameter and all those after it.  If you want to 
  1752. share batch files or aliases between 4DOS and 4OS2, you can select a new 
  1753. character for any product with the SETDOS /P command or the ParameterChar 
  1754. directive in your .INI file. 
  1755.  
  1756. For example, if your batch file interprets the first argument as a subdirectory 
  1757. name then the following line would move to the specified directory: 
  1758.  
  1759.         cd %1
  1760.  
  1761. Batch files can also use environment variables, internal variables, and 
  1762. variable functions. 
  1763.  
  1764.  
  1765. ΓòÉΓòÉΓòÉ 9.4. Automatic Batch Files ΓòÉΓòÉΓòÉ
  1766.  
  1767. Each time 4OS2 starts as either a primary or a secondary shell, it looks for an 
  1768. automatic batch file called 4START.BTM or 4START.CMD.  If the 4START batch file 
  1769. is not in the same directory as 4OS2 itself, you should use the 4StartPath 
  1770. directive in your .INI file to specify its location.  4START is optional, so 
  1771. 4OS2 will not display an error message if it cannot find the file. 
  1772.  
  1773. Whenever a 4OS2 shell ends, it runs a third automatic batch file called 
  1774. 4EXIT.BTM, 4EXIT.CMD.  This file, if you use it, should be in the same 
  1775. directory as your 4START batch file.  Like 4START, 4EXIT is optional.  It is 
  1776. not necessary in most circumstances, but it is a convenient place to put 
  1777. commands to save information such as a history list before a shell ends, or LOG 
  1778. the end of the shell. 
  1779.  
  1780.  
  1781. ΓòÉΓòÉΓòÉ 9.5. Detecting 4OS2 ΓòÉΓòÉΓòÉ
  1782.  
  1783. From a batch file, you can determine if 4OS2 is loaded by testing for the 
  1784. variable function @EVAL, with a test like this: 
  1785.  
  1786.         if "%@eval[2+2]" == "4" echo 4OS2 is loaded!
  1787.  
  1788. This test can never succeed in CMD.EXE. Other variable functions could be used 
  1789. for the same purpose. 
  1790.  
  1791.  
  1792. ΓòÉΓòÉΓòÉ 9.6. Batch File Compression ΓòÉΓòÉΓòÉ
  1793.  
  1794. You can compress your .BTM files with a program called BATCOMP.EXE, which is 
  1795. distributed with 4OS2.  This program condenses batch files by about a third and 
  1796. makes them unreadable with the LIST command and similar utilities.  Compressed 
  1797. batch files run at approximately the same speed as regular .BTM files. 
  1798.  
  1799. You may want to consider compressing batch files if you need to distribute them 
  1800. to others and keep your original code secret or prevent your users from 
  1801. altering them.  You may also want to consider compressing batch files to save 
  1802. some disk space on the systems where the compressed files are used. 
  1803.  
  1804. The full syntax for the batch compression program is 
  1805.  
  1806.         BATCOMP [/O] input file [output file ]
  1807.  
  1808. You must specify the full name of the input file, including its extension, on 
  1809. the BATCOMP command line.  If you do not specify the output file, BATCOMP will 
  1810. use the same base name as the input file and add a .BTM extension.  BATCOMP 
  1811. will also add a .BTM extension if you specify a base name for the output file 
  1812. without an extension.  For example, to compress MYBATCH.CMD and save the result 
  1813. as MYBATCH.BTM, you can use any of these three commands: 
  1814.  
  1815.         [c:\] batcomp mybatch.cmd
  1816.         [c:\] batcomp mybatch.cmd mybatch
  1817.         [c:\] batcomp mybatch.cmd mybatch.btm
  1818.  
  1819. If the output file (MYBATCH.BTM in the examples above) already exists, BATCOMP 
  1820. will prompt you before overwriting the file.  You can disable the prompt by 
  1821. including /O on the BATCOMP command line immediately before the input file 
  1822. name.  Even if you use the /O option, BATCOMP will not compress a file into 
  1823. itself. 
  1824.  
  1825. JP Software does not provide a decompression utility to uncompress batch files. 
  1826. If you use BATCOMP.EXE, make sure that you also keep a copy of the original 
  1827. batch file for future inspection or modification. 
  1828.  
  1829. Each of our command processors includes its own version of BATCOMP.EXE, set up 
  1830. to run under the corresponding operating system. However, the output produced 
  1831. by each program is the same, so a batch file compressed with any version of 
  1832. BATCOMP can be used with any JP Software command processor. 
  1833.  
  1834. If you plan to distribute batch files to users of different platforms, see 
  1835. 4DOS, 4OS2, and 4DOS/NT Compatibility. 
  1836.  
  1837.  
  1838. ΓòÉΓòÉΓòÉ 9.7. Argument Quoting ΓòÉΓòÉΓòÉ
  1839.  
  1840. As it parses the command line, 4OS2 looks for the ampersand [&] command 
  1841. separator, conditional commands (|| or &&), white space (spaces, tabs, and 
  1842. commas), percent signs [%] which indicate variables to be expanded, and 
  1843. redirection and piping characters (>, <, or |). 
  1844.  
  1845. Normally, these special characters cannot be passed to a command as part of an 
  1846. argument.  However, you can include any of the special characters in an 
  1847. argument by enclosing the entire argument in single back quotes [`] or double 
  1848. quotes ["].  Although both back quotes and double quotes will let you build 
  1849. arguments that include special characters, they do not work the same way. 
  1850.  
  1851. No alias or variable expansion is performed on an argument enclosed in back 
  1852. quotes.  Redirection symbols inside the back quotes are ignored.  The back 
  1853. quotes are removed from the command line before the command is executed. 
  1854.  
  1855. No alias expansion is performed on expressions enclosed in double quotes. 
  1856. Redirection symbols inside double quotes are ignored. However, variable 
  1857. expansion is performed on expressions inside double quotes.  The double quotes 
  1858. themselves will be passed to the command as part of the argument. 
  1859.  
  1860. For example, suppose you have a batch file CHKNAME.BTM which expects a name as 
  1861. its first parameter (%1).  Normally the name is a single word.  If you need to 
  1862. pass a two-word name with a space in it to this batch file you could use the 
  1863. command: 
  1864.  
  1865.         [c:\] chkname `MY NAME`
  1866.  
  1867. Inside the batch file, %1 will have the value MY NAME, including the space. 
  1868. The back quotes caused 4OS2 to pass the string to the batch file as a single 
  1869. argument.  The quotes keep characters together and reduce the number of 
  1870. arguments in the line. 
  1871.  
  1872. When an alias is defined in a batch file or from the command line, its argument 
  1873. can be enclosed in back quotes to prevent the expansion of replaceable 
  1874. parameters, variables, and multiple commands until the alias is invoked.  See 
  1875. ALIAS for details. 
  1876.  
  1877. You can disable and re-enable back quotes and double quotes with the SETDOS /X 
  1878. command. 
  1879.  
  1880.  
  1881. ΓòÉΓòÉΓòÉ 9.8. 4DOS, 4OS2, and 4DOS/NT Compatibility ΓòÉΓòÉΓòÉ
  1882.  
  1883. If you use two or more of our products, or if you want to share aliases and 
  1884. batch files with users of different products, you need to be aware of the 
  1885. differences in three important characters:  the Command Separator (see Multiple 
  1886. Commands), the Escape Character (see Escape Character), and the Parameter 
  1887. Character (see Batch File Parameters). 
  1888.  
  1889. The default values of each of these characters in each product is shown in the 
  1890. following chart (in this section, <Ctrl-X> stands for the ASCII Ctrl-X 
  1891. character, numeric value 24.  This character appears on your screen as an 
  1892. up-arrow [].): 
  1893.  
  1894.         Character           4DOS Default   4OS2 and 4NT Default
  1895.  
  1896.         Command Separator        ^              &
  1897.         Escape Character         <Ctrl-X>       ^
  1898.         Parameter Character      &              $
  1899.  
  1900. In your batch files and aliases, and even at the command line, you can smooth 
  1901. over these differences in two ways: 
  1902.  
  1903.         *   Select a consistent set of characters with .INI file configuration 
  1904.             directives or the SETDOS command.  For example, to set the 4OS2 
  1905.             characters to match 4DOS, use: 
  1906.  
  1907.                                 CommandSep = ^
  1908.                                 EscapeChar = <Ctrl-X>
  1909.                                 ParameterChar = &
  1910.  
  1911.             in 4OS2.INI. 
  1912.  
  1913.         *   Use internal variables that contain the current special character, 
  1914.             rather than using the character itself (see + and =).  For example, 
  1915.             this command: 
  1916.  
  1917.                                 if "%1" == "" (echo Argument missing! ^ quit)
  1918.  
  1919.             will only work if the command separator is a caret. However, this 
  1920.             version works regardless of the current command separator: 
  1921.  
  1922.                                 if "%1" == "" (echo Argument missing! %+ quit)
  1923.  
  1924.  
  1925.  The following chart shows the correspondence between the appropriate SETDOS 
  1926.  command options, .INI file directives, and internal variables: 
  1927.  
  1928.           Special                 SETDOS   INI File     Internal
  1929.           Character               Switch   Directive    Variable
  1930.  
  1931.           Command Separator        /C      CommandSep     %+
  1932.           Escape Character         /E      EscapeChar     %=
  1933.           Parameter Character      /P      ParameterChar  (none)
  1934.  
  1935.  
  1936. ΓòÉΓòÉΓòÉ 9.9. REXX Support ΓòÉΓòÉΓòÉ
  1937.  
  1938. REXX is a a powerful file and text processing language developed by IBM, and 
  1939. available on many PC and other platforms.  REXX is an ideal extension to the 
  1940. 4OS2 batch language, especially if you need advanced string processing 
  1941. capabilities. 
  1942.  
  1943. The REXX language is not built into 4OS2.  Under IBM OS/2 1.3 and above you can 
  1944. use the built-in REXX language provided by IBM, or use Personal REXX for OS/2, 
  1945. developed by Quercus Systems of Saratoga, CA.  (Personal REXX is available from 
  1946. JP Software or directly from Quercus Systems.) 
  1947.  
  1948. REXX programs are stored in .CMD files.  4OS2 checks to see if the first two 
  1949. characters on the first line of a .CMD file are [/*], the beginning of a REXX 
  1950. comment.  If so, it passes the file to OS/2's built-in REXX facility for 
  1951. processing.  If Personal REXX for OS/2 is installed, it automatically replaces 
  1952. OS/2's built-in REXX, and handles all REXX commands passed by 4OS2. 
  1953.  
  1954. Both Personal REXX and OS/2's built-in REXX extend the interface between REXX 
  1955. and 4OS2 by allowing you to invoke 4OS2 commands from within a REXX program. 
  1956. For details, or for more information on any aspect of REXX, see your Personal 
  1957. REXX or OS/2 REXX documentation. 
  1958.  
  1959.  
  1960. ΓòÉΓòÉΓòÉ 9.10. EXTPROC Support ΓòÉΓòÉΓòÉ
  1961.  
  1962. 4OS2 offers an external processor (EXTPROC) option for batch files that lets 
  1963. you define an external program to process a particular .CMD file.  To identify 
  1964. a .CMD file to be used with an external processor, place the string "EXTPROC" 
  1965. as the first word on the first line of the file, followed by the name of the 
  1966. external program that should be called.  4OS2 will start the program and pass 
  1967. it the name of the .CMD file and any command-line arguments that were entered. 
  1968.  
  1969. For example, suppose GETDATA.CMD contains the following lines: 
  1970.  
  1971.         EXTPROC D:\DATAACQ\DATALOAD.EXE
  1972.         OPEN PORT1
  1973.         READ 4000
  1974.         DISKWRITE D:\DATAACQ\PORT1\RAW
  1975.  
  1976. Then if you entered the command: 
  1977.  
  1978.         [d:\dataacq] getdata /p17
  1979.  
  1980. 4OS2 would read the GETDATA.CMD file, determine that it began with an EXTPROC 
  1981. command, read the name of the processor program, and then execute the command: 
  1982.  
  1983.         D:\DATAACQ\DATALOAD.EXE D:\DATAACQ\GETDATA.CMD /p17
  1984.  
  1985. The hypothetical DATALOAD.EXE program would then be responsible for reopening 
  1986. the GETDATA.CMD file, ignoring the EXTPROC line at the start, and interpreting 
  1987. the other instructions in the file. It would also have to respond appropriately 
  1988. to the command-line parameter entered (/p17). 
  1989.  
  1990. Do not try to use 4OS2 as the external processor named on the EXTPROC line in 
  1991. the .CMD file.  It will interpret the EXTPROC line as a command to re-open 
  1992. themselves.  The result will be an infinite loop that will continue until the 
  1993. computer runs out of resources and locks up. 
  1994.  
  1995.  
  1996. ΓòÉΓòÉΓòÉ 10. The Environment ΓòÉΓòÉΓòÉ
  1997.  
  1998. The environment is a collection of information about your computer that every 
  1999. program receives.  Each entry in the environment consists of a variable name, 
  2000. followed by an equal sign and a string of text.  You can automatically 
  2001. substitute the text for the variable name in any command.  To create the 
  2002. substitution, include a percent sign [%] and a variable name on the command 
  2003. line or in an alias or batch file. 
  2004.  
  2005. The following environment variables have special meanings in 4OS2: 
  2006.  
  2007.             CDPATH 
  2008.             CMDLINE 
  2009.             COLORDIR 
  2010.             COMSPEC 
  2011.             PATH 
  2012.             PROMPT 
  2013.  
  2014.  4OS2 also supports two special types of variables.  Internal variables are 
  2015.  similar to environment variables, but are stored internally within 4OS2, and 
  2016.  are not visible in the environment.  They provide information about your 
  2017.  system for use in batch files and aliases.  Variable functions are referenced 
  2018.  like environment variables, but perform additional functions like file 
  2019.  handling, string manipulation and arithmetic calculations. 
  2020.  
  2021.  The SET command is used to create environment variables. For example, you can 
  2022.  create a variable named BACKUP like this: 
  2023.  
  2024.           [c:\] set BACKUP=*.bak;*.bk!;*.bk
  2025.  
  2026.  If you then type 
  2027.  
  2028.           [c:\] del %BACKUP
  2029.  
  2030.  it is equivalent to the following command: 
  2031.  
  2032.           del *.bak;*.bk!;*.bk
  2033.  
  2034.  The variable names you use this way may contain any alphabetic or numeric 
  2035.  characters, the underscore character [_], and the dollar sign [$].  You can 
  2036.  force acceptance of other characters by including the full variable name in 
  2037.  square brackets, like this: %[AB##2].  You can also "nest" environment 
  2038.  variables using square brackets.  For example %[%var1] means "the contents of 
  2039.  the variable whose name is stored in VAR1".  A variable referenced with this 
  2040.  technique cannot contain more than 255 characters of information.  Nested 
  2041.  variable expansion can be disabled with the SETDOS /X command. 
  2042.  
  2043.  In 4OS2 the size of the environment is set automatically, and increased as 
  2044.  needed when you add variables. 
  2045.  
  2046.  The trailing percent sign that was traditionally required for environment 
  2047.  variable names is not usually required in 4OS2, which accept any character 
  2048.  that cannot be part of a variable name as the terminator.  However, the 
  2049.  trailing percent can be used to maintain compatibility. 
  2050.  
  2051.  The trailing percent sign is needed if you want to join two variable values. 
  2052.  The following examples show the possible interactions between variables and 
  2053.  literal strings.  First, create two environment variables called ONE and TWO 
  2054.  this way: 
  2055.  
  2056.           [c:\] set ONE=abcd
  2057.           [c:\] set TWO=efgh
  2058.  
  2059.  Now the following combinations produce the output text shown: 
  2060.  
  2061.           %ONE%TWO            abcdTWO   ("%ONE%" + "TWO")
  2062.           %ONE%TWO%           abcdTWO   ("%ONE%" + "TWO%")
  2063.           %ONE%%TWO           abcdefgh  ("%ONE%" + "%TWO")
  2064.           %ONE%%TWO%          abcdefgh  ("%ONE%" + "%TWO%")
  2065.           %ONE%[TWO]          abcd[TWO] ("%ONE%" + "[TWO]")
  2066.           %ONE%[TWO]%         abcd[TWO] ("%ONE%" + "[TWO]%")
  2067.           %[ONE]%TWO          abcdefgh  ("%[ONE]" + "%TWO")
  2068.           %[ONE]%TWO%         abcdefgh  ("%[ONE]" + "%TWO%")
  2069.  
  2070.  If you want to pass a percent sign to a command, or a string which includes a 
  2071.  percent sign, you must use two percent signs in a row. Otherwise, the single 
  2072.  percent sign will be seen as the beginning of a variable name and will not be 
  2073.  passed on to the command.  For example, to display the string "We're with you 
  2074.  100%" you would use the command: 
  2075.  
  2076.           echo We're with you 100%%
  2077.  
  2078.  You can also use back quotes around the text, rather than a double percent 
  2079.  sign.  See Argument Quoting for details. 
  2080.  
  2081.  
  2082. ΓòÉΓòÉΓòÉ 10.1. CDPATH ΓòÉΓòÉΓòÉ
  2083.  
  2084. CDPATH tells 4OS2 where to search for directories specified by the CD, CDD, and 
  2085. PUSHD commands and in automatic directory changes.  (_CDPATH can be used as an 
  2086. alternative to CDPATH if you are using Microsoft Bookshelf, which uses a CDPATH 
  2087. variable for its own purposes.) 
  2088.  
  2089. CDPATH is composed of a list of directories, separated by semicolons [;].  If 
  2090. CD, CDD, PUSHD, or an automatic directory change can't locate the specified 
  2091. directory to change to, they will append the specified directory name to each 
  2092. directory in CDPATH and attempt to change to that drive and directory, until 
  2093. the first match or the end of the CDPATH argument.  This allows you to use 
  2094. CDPATH as a quick way to find commonly used subdirectories which have unique 
  2095. names.  For example, if you are currently in the directory 
  2096. C:\WP\LETTERS\JANUARY and you'd like to change to D:\SOFTWARE\UTIL, you could 
  2097. enter the command: 
  2098.  
  2099.         [c:\wp\letters\january] cdd d:\software\util
  2100.  
  2101. However, if the D:\SOFTWARE directory is listed in your CDPATH variable, and is 
  2102. the first directory in the list with a UTIL subdirectory, you can simply enter 
  2103. the command 
  2104.  
  2105.         [c:\wp\letters\january] cdd util
  2106.  
  2107. to change to D:\SOFTWARE\UTIL. 
  2108.  
  2109. You can create CDPATH with the SET command.  For example, if you want the 
  2110. directory change commands to search the C:\DATA directory, the D:\SOFTWARE 
  2111. directory, and the root directory of drive E:\ for the subdirectories that you 
  2112. name, you should create CDPATH with this command: 
  2113.  
  2114.         [c:\] set cdpath=c:\data;d:\software;e:\
  2115.  
  2116.  
  2117. ΓòÉΓòÉΓòÉ 10.2. CMDLINE ΓòÉΓòÉΓòÉ
  2118.  
  2119. CMDLINE is the fully expanded text of the currently executing command line. 
  2120. CMDLINE is set just before invoking any .COM, .EXE, .BTM, .BAT, or .CMD file. 
  2121. If a command line is prefaced with an "@" to prevent echoing, it will not be 
  2122. put in CMDLINE, and any previous CMDLINE variable will be removed from the 
  2123. environment. 
  2124.  
  2125.  
  2126. ΓòÉΓòÉΓòÉ 10.3. COLORDIR ΓòÉΓòÉΓòÉ
  2127.  
  2128. COLORDIR controls directory display colors used by DIR and SELECT.  See 
  2129. Color-Coded Directories for a complete description of the format of this 
  2130. variable. 
  2131.  
  2132.  
  2133. ΓòÉΓòÉΓòÉ 10.4. COMSPEC ΓòÉΓòÉΓòÉ
  2134.  
  2135. COMSPEC contains the full path and name of 4OS2.  For example, if 4OS2 is 
  2136. stored in the directory C:\4OS2, the COMSPEC variable should be set to 
  2137. C:\4OS2\4OS2.EXE.  COMSPEC is used by applications which need to find 4OS2 to 
  2138. implement a "shell to the command prompt" feature. 
  2139.  
  2140. You can set the COMSPEC variable by specifying the COMSPEC path with a SET 
  2141. COMSPEC command in CONFIG.SYS, or including the COMSPEC path on the 4OS2 
  2142. startup command line. 
  2143.  
  2144.  
  2145. ΓòÉΓòÉΓòÉ 10.5. PATH ΓòÉΓòÉΓòÉ
  2146.  
  2147. PATH is a list of directories that 4OS2 will search for executable files that 
  2148. aren't in the current directory.  PATH may also be used by some application 
  2149. programs to find their own files. See the PATH command for a full description 
  2150. of this variable. 
  2151.  
  2152.  
  2153. ΓòÉΓòÉΓòÉ 10.6. PROMPT ΓòÉΓòÉΓòÉ
  2154.  
  2155. PROMPT defines the command-line prompt.  It can be set or changed with the 
  2156. PROMPT command. 
  2157.  
  2158.  
  2159. ΓòÉΓòÉΓòÉ 11. Internal Variables ΓòÉΓòÉΓòÉ
  2160.  
  2161. Internal variables are special variables built into 4OS2 to provide information 
  2162. about your system.  They are not actually stored in the environment, but can be 
  2163. used in commands, aliases, and batch files just like any environment variable. 
  2164. The values of these variables are stored internally in 4OS2, and cannot be 
  2165. changed with the SET, UNSET, or ESET command.  However, you can override any of 
  2166. these variables by defining a new variable with the same name. 
  2167.  
  2168. The list below gives a one-line description of each variable, and a 
  2169. cross-reference which selects a full screen help topic on that variable. Most 
  2170. of the variables are simple enough that the one-line description is sufficient. 
  2171. However, for those variables marked with an asterisk [*], the cross-reference 
  2172. topic contains some additional information you may wish to review.  You can 
  2173. also obtain help on any variable with a HELP variablename command at the prompt 
  2174. (this is why each variable has its own topic, in addition to its appearance in 
  2175. the list below). 
  2176.  
  2177. See the discussion after the variable list for some additional information, and 
  2178. examples of how these variables can be used. 
  2179.  
  2180. The variables are: 
  2181.  
  2182. Hardware status 
  2183.  
  2184.         _CPU            CPU type (86, 186, 200, 386, 486, 586) 
  2185.         _MONITOR        Monitor type (mono or color) 
  2186.         _NDP            Coprocessor type (0, 87, 287, 387) 
  2187.         _VIDEO          Video board type (mono, cga, ega, vga, xga, 8514, or 
  2188.                         IA/A) 
  2189.  
  2190.  Operating system and software status 
  2191.  
  2192.         _ANSI           ANSI status (always 1 in 4OS2) 
  2193.         _BOOT           Boot drive letter, without a colon 
  2194.         _CODEPAGE       Current code page number 
  2195.         _COUNTRY        Current country code 
  2196.         _DOS            * Operating system (DOS, OS2, or NT) 
  2197.         _DOSVER         * Operating system version (2.0, 2.1, etc.) 
  2198.         _MOUSE          Mouse driver flag (always 1 in 4OS2) 
  2199.  
  2200.  Command processor status 
  2201.  
  2202.         _4VER           4OS2 version (2.0, 2.01, etc.) 
  2203.         _BATCH          Batch nesting level 
  2204.         _HLOGFILE       Current history log file name 
  2205.         _LOGFILE        Current log file name 
  2206.         _PID            4OS2 process ID (numeric) 
  2207.         _PPID           Parent process ID (numeric) 
  2208.         _PTYPE          OS/2 session type (AVIO, DT, FS, PM) 
  2209.         _SHELL          Shell level (0, 1, 2, ...) 
  2210.         _SID            Current OS/2 session ID 
  2211.         _TRANSIENT      * Transient shell flag (0 or 1) 
  2212.         _WINTITLE       Current window title 
  2213.  
  2214.  Screen and color 
  2215.  
  2216.         _BG             Background color at cursor position 
  2217.         _COLUMN         Current cursor column 
  2218.         _COLUMNS        Screen width 
  2219.         _FG             Foreground color at cursor position 
  2220.         _ROW            Current cursor row 
  2221.         _ROWS           Screen height 
  2222.  
  2223.  Drives and directories 
  2224.  
  2225.         _CWD            Current drive and directory (d:\path) 
  2226.         _CWDS           Current drive and directory with trailing \ (d:\path\) 
  2227.         _CWP            Current directory (\path) 
  2228.         _CWPS           Current directory with trailing \ (\path\) 
  2229.         _DISK           Current drive (C, D, etc.) 
  2230.         _LASTDISK       Last possible drive (E, F, etc.) 
  2231.  
  2232.  Dates and times 
  2233.  
  2234.         _DATE           * Current date (mm-dd-yy) 
  2235.         _DAY            Day of the month (1 - 31) 
  2236.         _DOW            Day of the week (Mon, Tue, Wed, etc.) 
  2237.         _DOY            Day of the year (1 - 366) 
  2238.         _HOUR           Hour (0 - 23) 
  2239.         _MINUTE         Minute (0 - 59) 
  2240.         _MONTH          Month of the year (1 - 12) 
  2241.         _SECOND         Second (0 - 59) 
  2242.         _TIME           * Current time (hh:mm:ss) 
  2243.         _YEAR           Year (1980 - 2099) 
  2244.  
  2245.  Error codes 
  2246.  
  2247.         ?               * Exit code, last external program 
  2248.         _?              * Exit code, last internal command 
  2249.         _SYSERR         * Last OS/2 error code 
  2250.  
  2251.  Compatibility 
  2252.  
  2253.         =               * Substitutes escape character 
  2254.         +               * Substitutes command separator 
  2255.  
  2256.  Examples 
  2257.  
  2258.  You can use these variables in a wide variety of ways depending on your needs. 
  2259.  Here are just a few examples.  Some of these examples rely on the IF and IFF 
  2260.  commands to test the value of a variable and perform different actions based 
  2261.  on that value. 
  2262.  
  2263.  In a batch file, set the color based on the video card type: 
  2264.  
  2265.           iff "%_video"=="mono" then
  2266.             color bright white on black
  2267.           else
  2268.             color bright white on blue
  2269.           endiff
  2270.  
  2271.  Store the current date and time in a file, then save the output of a DIR 
  2272.  command in the same file: 
  2273.  
  2274.           echo Directory as of %_date %_time > dirsave
  2275.           dir >> dirsave
  2276.  
  2277.  Set up a prompt for the primary shell which displays the time and current 
  2278.  directory, and a different one for secondary shells which includes the shell 
  2279.  level rather than the time (see PROMPT for details about setting the prompt). 
  2280.  Also set different background colors for the two shells, without changing the 
  2281.  foreground color.  You might use a sequence like this in your 4START file (see 
  2282.  Automatic Batch Files): 
  2283.  
  2284.           iff %_shell==0 then
  2285.             prompt $t $p$g
  2286.             color %_fg on blue
  2287.           else
  2288.             prompt [$z] $p$g
  2289.             color %_fg on cyan
  2290.           endiff
  2291.  
  2292.  
  2293. ΓòÉΓòÉΓòÉ 11.1. ? ΓòÉΓòÉΓòÉ
  2294.  
  2295. ? contains the exit code of the last external command.  Many programs return a 
  2296. "0" to indicate success and a non-zero value to signal an error.  However, not 
  2297. all programs return an exit code.  If no explicit exit code is returned, the 
  2298. value of %? is undefined. 
  2299.  
  2300.  
  2301. ΓòÉΓòÉΓòÉ 11.2. _? ΓòÉΓòÉΓòÉ
  2302.  
  2303. _? contains the exit code of the last internal command.  It is set to "0" if 
  2304. the command was successful, "1" if a usage error occurred, "2" if another 
  2305. command processor error or an operating system error occurred, or "3" if the 
  2306. command was interrupted by Ctrl-C or Ctrl-Break.  You must use or save this 
  2307. value immediately, because it is set by every internal command. 
  2308.  
  2309.  
  2310. ΓòÉΓòÉΓòÉ 11.3. = ΓòÉΓòÉΓòÉ
  2311.  
  2312. = returns the current escape character.  Use this variable, instead of the 
  2313. actual escape character, if you want your batch files and aliases to work 
  2314. regardless of how the escape character is defined.  For example, if the escape 
  2315. character is a caret [^] (the default in 4OS2) both of the commands below will 
  2316. send a form feed to the printer.  However, if the escape character has been 
  2317. changed,  the first command will send the string "^f" to the printer, while the 
  2318. second command will continue to work as intended. 
  2319.  
  2320.         echos ^f > prn
  2321.         echos %=f > prn
  2322.  
  2323.  
  2324. ΓòÉΓòÉΓòÉ 11.4. + ΓòÉΓòÉΓòÉ
  2325.  
  2326. + returns the current command separator.  Use this variable, instead of the 
  2327. actual command separator, if you want your batch files and aliases to work 
  2328. regardless of how the command separator is defined.  For example, if the 
  2329. command separator is an ampersand [&] (the default in 4OS2) both of the 
  2330. commands below will display "Hello" on one line and "world" on the next. 
  2331. However, if the command separator has been changed the first command will 
  2332. display "Hello & echo world", while the second command will continue to work as 
  2333. intended. 
  2334.  
  2335.         echo Hello & echo world
  2336.         echo Hello %+ echo world
  2337.  
  2338.  
  2339. ΓòÉΓòÉΓòÉ 11.5. _4VER ΓòÉΓòÉΓòÉ
  2340.  
  2341. _4VER is the current 4OS2 version (for example, "2.0"). 
  2342.  
  2343.  
  2344. ΓòÉΓòÉΓòÉ 11.6. _ANSI ΓòÉΓòÉΓòÉ
  2345.  
  2346. _ANSI is always "1" in 4OS2.  (4OS2 enables OS/2's ANSI support, and assumes 
  2347. that it remains enabled.) 
  2348.  
  2349.  
  2350. ΓòÉΓòÉΓòÉ 11.7. _BATCH ΓòÉΓòÉΓòÉ
  2351.  
  2352. _BATCH is the current batch nesting level.  It is "0" if no batch file is 
  2353. currently being processed. 
  2354.  
  2355.  
  2356. ΓòÉΓòÉΓòÉ 11.8. _BG ΓòÉΓòÉΓòÉ
  2357.  
  2358. _BG is a string containing the first three characters of the screen background 
  2359. color at the current cursor location (for example, "Bla"). 
  2360.  
  2361.  
  2362. ΓòÉΓòÉΓòÉ 11.9. _BOOT ΓòÉΓòÉΓòÉ
  2363.  
  2364. _BOOT is the boot drive letter, without a colon. 
  2365.  
  2366.  
  2367. ΓòÉΓòÉΓòÉ 11.10. _CODEPAGE ΓòÉΓòÉΓòÉ
  2368.  
  2369. _CODEPAGE is the current code page number (see CHCP). 
  2370.  
  2371.  
  2372. ΓòÉΓòÉΓòÉ 11.11. _COLUMN ΓòÉΓòÉΓòÉ
  2373.  
  2374. _COLUMN is the current cursor column (for example, "0" for the left side of the 
  2375. screen). 
  2376.  
  2377.  
  2378. ΓòÉΓòÉΓòÉ 11.12. _COLUMNS ΓòÉΓòÉΓòÉ
  2379.  
  2380. _COLUMNS is the current number of screen columns (for example, "80"). 
  2381.  
  2382.  
  2383. ΓòÉΓòÉΓòÉ 11.13. _COUNTRY ΓòÉΓòÉΓòÉ
  2384.  
  2385. _COUNTRY is the current country code. 
  2386.  
  2387.  
  2388. ΓòÉΓòÉΓòÉ 11.14. _CPU ΓòÉΓòÉΓòÉ
  2389.  
  2390. _CPU is the CPU type: 
  2391.  
  2392.         86      8086 and 8088 
  2393.         186     80186 and 80188 
  2394.         200     NEC V20 and V30 
  2395.         286     80286 
  2396.         386     i386 
  2397.         486     i486 
  2398.         586     Pentium 
  2399.  
  2400.  
  2401. ΓòÉΓòÉΓòÉ 11.15. _CWD ΓòÉΓòÉΓòÉ
  2402.  
  2403. _CWD is the current working directory in the format d:\pathname. 
  2404.  
  2405.  
  2406. ΓòÉΓòÉΓòÉ 11.16. _CWDS ΓòÉΓòÉΓòÉ
  2407.  
  2408. _CWDS has the same value as CWD, except it ends the pathname with a backslash 
  2409. [\]. 
  2410.  
  2411.  
  2412. ΓòÉΓòÉΓòÉ 11.17. _CWP ΓòÉΓòÉΓòÉ
  2413.  
  2414. _CWP is the current working directory in the format \pathname. 
  2415.  
  2416.  
  2417. ΓòÉΓòÉΓòÉ 11.18. _CWPS ΓòÉΓòÉΓòÉ
  2418.  
  2419. _CWPS has the same value as CWP, except it ends the pathname with a backslash 
  2420. [\]. 
  2421.  
  2422.  
  2423. ΓòÉΓòÉΓòÉ 11.19. _DATE ΓòÉΓòÉΓòÉ
  2424.  
  2425. _DATE contains the current system date, in the format mm-dd-yy (U.S.), dd-mm-yy 
  2426. (Europe), or yy-mm-dd (Japan). 
  2427.  
  2428.  
  2429. ΓòÉΓòÉΓòÉ 11.20. _DAY ΓòÉΓòÉΓòÉ
  2430.  
  2431. _DAY is the day of the month (1 to 31). 
  2432.  
  2433.  
  2434. ΓòÉΓòÉΓòÉ 11.21. _DISK ΓòÉΓòÉΓòÉ
  2435.  
  2436. _DISK is the current disk drive, without a colon (for example, "C"). 
  2437.  
  2438.  
  2439. ΓòÉΓòÉΓòÉ 11.22. _DOS ΓòÉΓòÉΓòÉ
  2440.  
  2441. _DOS is the operating system type ("DOS", "OS2", or "NT").  4DOS always returns 
  2442. "DOS", 4OS2 always returns "OS2", and 4DOS/NT always returns "NT".  This may be 
  2443. useful if you have batch files running under more than one operating system. 
  2444.  
  2445.  
  2446. ΓòÉΓòÉΓòÉ 11.23. _DOSVER ΓòÉΓòÉΓòÉ
  2447.  
  2448. _DOSVER is the current operating system version (for example, "2.1"). 
  2449.  
  2450.  
  2451. ΓòÉΓòÉΓòÉ 11.24. _DOW ΓòÉΓòÉΓòÉ
  2452.  
  2453. _DOW is the first three characters of the current day of the week ("Mon", 
  2454. "Tue", "Wed", etc.). 
  2455.  
  2456.  
  2457. ΓòÉΓòÉΓòÉ 11.25. _DOY ΓòÉΓòÉΓòÉ
  2458.  
  2459. _DOY is the day of the year (1 to 366). 
  2460.  
  2461.  
  2462. ΓòÉΓòÉΓòÉ 11.26. _FG ΓòÉΓòÉΓòÉ
  2463.  
  2464. _FG is a string containing the first three letters of the screen foreground 
  2465. color at the current cursor position (for example, "Whi"). 
  2466.  
  2467.  
  2468. ΓòÉΓòÉΓòÉ 11.27. _HLOGFILE ΓòÉΓòÉΓòÉ
  2469.  
  2470. _HLOGFILE  returns the name of the current history log file (or an empty string 
  2471. if LOG /H is OFF). 
  2472.  
  2473.  
  2474. ΓòÉΓòÉΓòÉ 11.28. _HOUR ΓòÉΓòÉΓòÉ
  2475.  
  2476. _HOUR is the current hour (0 - 23). 
  2477.  
  2478.  
  2479. ΓòÉΓòÉΓòÉ 11.29. _LASTDISK ΓòÉΓòÉΓòÉ
  2480.  
  2481. _LASTDISK is the last valid drive letter, without a colon. 
  2482.  
  2483.  
  2484. ΓòÉΓòÉΓòÉ 11.30. _LOGFILE ΓòÉΓòÉΓòÉ
  2485.  
  2486. _LOGFILE  returns the name of the current log file (or an empty string if LOG 
  2487. is OFF). 
  2488.  
  2489.  
  2490. ΓòÉΓòÉΓòÉ 11.31. _MINUTE ΓòÉΓòÉΓòÉ
  2491.  
  2492. _MINUTE is the current minute (0 - 59). 
  2493.  
  2494.  
  2495. ΓòÉΓòÉΓòÉ 11.32. _MONITOR ΓòÉΓòÉΓòÉ
  2496.  
  2497. _MONITOR is the monitor type ("mono" or "color"). 
  2498.  
  2499.  
  2500. ΓòÉΓòÉΓòÉ 11.33. _MONTH ΓòÉΓòÉΓòÉ
  2501.  
  2502. _MONTH is the month of the year (1 to 12). 
  2503.  
  2504.  
  2505. ΓòÉΓòÉΓòÉ 11.34. _MOUSE ΓòÉΓòÉΓòÉ
  2506.  
  2507. _MOUSE always returns "1" in 4OS2. 
  2508.  
  2509.  
  2510. ΓòÉΓòÉΓòÉ 11.35. _NDP ΓòÉΓòÉΓòÉ
  2511.  
  2512. _NDP is the coprocessor type: 
  2513.  
  2514.         0       no coprocessor is installed 
  2515.         87      8087 
  2516.         287     80287 
  2517.         387     80387, 80486DX, or Pentium 
  2518.  
  2519.  
  2520. ΓòÉΓòÉΓòÉ 11.36. _PID ΓòÉΓòÉΓòÉ
  2521.  
  2522. _PID is the current process ID number. 
  2523.  
  2524.  
  2525. ΓòÉΓòÉΓòÉ 11.37. _PPID ΓòÉΓòÉΓòÉ
  2526.  
  2527. _PPID is the process ID number of the parent process. 
  2528.  
  2529.  
  2530. ΓòÉΓòÉΓòÉ 11.38. _PTYPE ΓòÉΓòÉΓòÉ
  2531.  
  2532. _PTYPE is the current OS/2 process type: 
  2533.  
  2534.         AVIO    Character mode, windowed 
  2535.         DT      Detached (no screen in use) 
  2536.         FS      Character mode, full-screen 
  2537.         PM      Presentation Manager 
  2538.  
  2539.  
  2540. ΓòÉΓòÉΓòÉ 11.39. _ROW ΓòÉΓòÉΓòÉ
  2541.  
  2542. _ROW is the current cursor row (for example, "0" for the top of the screen). 
  2543.  
  2544.  
  2545. ΓòÉΓòÉΓòÉ 11.40. _ROWS ΓòÉΓòÉΓòÉ
  2546.  
  2547. _ROWS is the current number of screen rows (for example, "25"). 
  2548.  
  2549.  
  2550. ΓòÉΓòÉΓòÉ 11.41. _SECOND ΓòÉΓòÉΓòÉ
  2551.  
  2552. _SECOND is the current second (0 - 59). 
  2553.  
  2554.  
  2555. ΓòÉΓòÉΓòÉ 11.42. _SHELL ΓòÉΓòÉΓòÉ
  2556.  
  2557. _SHELL is the current shell nesting level.  The primary shell is level "0", and 
  2558. each subsequent secondary shell increments the level by 1. 
  2559.  
  2560.  
  2561. ΓòÉΓòÉΓòÉ 11.43. _SID ΓòÉΓòÉΓòÉ
  2562.  
  2563. _SID is the session ID number. 
  2564.  
  2565.  
  2566. ΓòÉΓòÉΓòÉ 11.44. _SYSERR ΓòÉΓòÉΓòÉ
  2567.  
  2568. _SYSERR is the error code of the last operating system error. You will need a 
  2569. technical or programmer's manual to understand these error values. 
  2570.  
  2571.  
  2572. ΓòÉΓòÉΓòÉ 11.45. _TIME ΓòÉΓòÉΓòÉ
  2573.  
  2574. _TIME contains the current system time in the format hh:mm:ss. The separator 
  2575. character may vary depending upon your country information. 
  2576.  
  2577.  
  2578. ΓòÉΓòÉΓòÉ 11.46. _TRANSIENT ΓòÉΓòÉΓòÉ
  2579.  
  2580. _TRANSIENT is "1" if the current shell is transient (started with a /C, see 
  2581. Startup Options for details), or "0" otherwise. 
  2582.  
  2583.  
  2584. ΓòÉΓòÉΓòÉ 11.47. _VIDEO ΓòÉΓòÉΓòÉ
  2585.  
  2586. _VIDEO is the video card type ("mono", "cga", "ega", "vga", "xga", "8514", or 
  2587. "IA/A"). 
  2588.  
  2589.  
  2590. ΓòÉΓòÉΓòÉ 11.48. _WINTITLE ΓòÉΓòÉΓòÉ
  2591.  
  2592. _WINTITLE returns the title of the current window. 
  2593.  
  2594.  
  2595. ΓòÉΓòÉΓòÉ 11.49. _YEAR ΓòÉΓòÉΓòÉ
  2596.  
  2597. _YEAR is the current year (1980 to 2099). 
  2598.  
  2599.  
  2600. ΓòÉΓòÉΓòÉ 12. Variable Functions ΓòÉΓòÉΓòÉ
  2601.  
  2602. Variable functions are like internal variables, but they take one or more 
  2603. arguments (which can be environment variables or even other variable functions) 
  2604. and they return a value. 
  2605.  
  2606. The list below gives a one-line description of each function, and a 
  2607. cross-reference which selects a full screen help topic on that function.  A few 
  2608. of the variables are simple enough that the one-line description is sufficient, 
  2609. but in most cases you should check for any additional information in the 
  2610. cross-reference topic if you are not already familiar with a function.  You can 
  2611. also obtain help on any function with a HELP @functionname command at the 
  2612. prompt. 
  2613.  
  2614. See the discussion after the function list for additional information and 
  2615. examples. 
  2616.  
  2617. The variable functions are: 
  2618.  
  2619. System status 
  2620.  
  2621.         @DOSMEM[b|k|m]                      Size of largest free memory block 
  2622.         @READSCR[row,col,len]               Read characters from the screen 
  2623.  
  2624.  Drives and devices 
  2625.  
  2626.         @CDROM[d:]                          CD-ROM drive detection (0 or 1) 
  2627.         @DEVICE[name]                       Character device detection 
  2628.         @DISKFREE[d:,b|k|m]                 Free disk space 
  2629.         @DISKTOTAL[d:,b|k|m]                Total disk space 
  2630.         @DISKUSED[d:,b|k|m]                 Used disk space 
  2631.         @FSTYPE[d:]                         File system type (FAT, HPFS, CDFS, 
  2632.                                             etc.) 
  2633.         @LABEL[d:]                          Volume label 
  2634.         @READY[d:]                          Drive ready status (0 or 1) 
  2635.         @REMOTE[d:]                         Remote (network) drive detection (0 
  2636.                                             or 1) 
  2637.         @REMOVABLE[d:]                      Removable drive detection (0 or 1) 
  2638.  
  2639.  Files 
  2640.  
  2641.         @ATTRIB[filename,rhsda]             File attribute test (0 or 1) 
  2642.         @DESCRIPT[filename]                 File description 
  2643.         @EXETYPE[filename]                  Executable file type (DOS, PM, WIN, 
  2644.                                             etc.) 
  2645.         @FILEAGE[filename]                  File age (date and time) 
  2646.         @FILECLOSE[n]                       Close a file 
  2647.         @FILEDATE[filename]                 File date 
  2648.         @FILEOPEN[filename,mode]            Open a file 
  2649.         @FILEREAD[n]                        Read next line from a file 
  2650.         @FILES[filename]                    Count files matching a wildcard 
  2651.         @FILESEEK[n,offset,start]           Move a file pointer 
  2652.         @FILESIZE[filename,b|k|m]           Size of files matching a wildcard 
  2653.         @FILETIME[filename]                 File time 
  2654.         @FILEWRITE[n,text]                  Write next line to a file 
  2655.         @FINDFIRST[filename,nrhsda]         Find first matching file 
  2656.         @FINDNEXT[filename,nrhsda]          Find next matching file 
  2657.         @LINE[filename,n]                   Read a random line from a file 
  2658.         @LINES[filename]                    Count lines in a file 
  2659.         @SEARCH[filename]                   Path search 
  2660.         @UNIQUE[d:\path]                    Create file with unique name 
  2661.  
  2662.  File names 
  2663.  
  2664.         @EXT[filename]                      File extension 
  2665.         @FILENAME[filename]                 File name and extension 
  2666.         @FULL[filename]                     Full file name with path 
  2667.         @NAME[filename]                     File name without path or extension 
  2668.         @PATH[filename]                     File path without name 
  2669.  
  2670.  Strings and characters 
  2671.  
  2672.         @ASCII[c]                           Numeric ASCII value for a character 
  2673.         @CHAR[n]                            Character value for numeric ASCII 
  2674.         @INDEX[string1,string2]             Position of one string in another 
  2675.         @INSTR[start,length,string]         Extract a substring 
  2676.         @LEN[string]                        Length of a string 
  2677.         @LOWER[string]                      Convert string to lower case 
  2678.         @REPEAT[c,n]                        Repeat a character 
  2679.         @SUBSTR[string,start,length]        Extract a substring 
  2680.         @TRIM[string]                       Remove blanks from a string 
  2681.         @UPPER[string]                      Convert string to upper case 
  2682.         @WORD[n,string]                     Extract a word from a string 
  2683.  
  2684.  Numbers and arithmetic 
  2685.  
  2686.         @DEC[%var]                          Decremented value of a variable 
  2687.         @EVAL[expression]                   Arithmetic calculations 
  2688.         @INC[%var]                          Incremented value of a variable 
  2689.         @INT[n]                             Integer part of a number 
  2690.         @NUMERIC[string]                    Test if a string is numeric 
  2691.         @RANDOM[min,max]                    Generate a random integer 
  2692.  
  2693.  Dates and times 
  2694.  
  2695.         @DATE[mm-dd-yy]                     Convert date to number of days 
  2696.         @MAKEDATE[n]                        Convert number of days to date 
  2697.         @MAKETIME[n]                        Convert number of seconds to time 
  2698.         @TIME[hh:mm:ss]                     Convert time to number of seconds 
  2699.  
  2700.  Utility 
  2701.  
  2702.         @ALIAS[name]                        Value of an alias 
  2703.         @SELECT[file,t,l,b,r,title]         Menu selection 
  2704.         @EXEC[command]                      Execute a command 
  2705.  
  2706.  Like all environment variables, these variable functions must be preceded by a 
  2707.  percent sign (%@EVAL, %@LEN, etc.).  All variable functions must have square 
  2708.  brackets enclosing their argument(s).  The argument(s) to a variable function 
  2709.  cannot exceed 255 characters in length for all arguments taken as a group. 
  2710.  
  2711.  Some variable functions, like @DISKFREE, are shown with "b|k|m" as one of 
  2712.  their arguments.  Those functions return a number of bytes, kilobytes, or 
  2713.  megabytes based on the "b|k|m" argument: 
  2714.  
  2715.         b   return the number of bytes 
  2716.         K   return the number of kilobytes (bytes / 1,024) 
  2717.         k   return the number of thousands of bytes (bytes / 1,000) 
  2718.         M   return the number of megabytes (bytes / 1,048,576) 
  2719.         m   return the number of millions of bytes (bytes / 1,000,000) 
  2720.  
  2721.  You can include commas in the results from a "b|k|m" function by appending a 
  2722.  "c" to the argument.  For example, to add commas to a "b" or number of bytes 
  2723.  result, enter "bc" as the argument. 
  2724.  
  2725.  In variable functions which take a drive letter as an argument, like @DISKFREE 
  2726.  or @READY, the drive letter must be followed by a colon.  The function will 
  2727.  not work properly if you use the drive letter without the colon. 
  2728.  
  2729.  The @FILEREAD, @FILEWRITE, @FILESEEK, and @FILECLOSE functions allow you to 
  2730.  access files based on their file handle.  These functions should only be used 
  2731.  with file handles returned by @FILEOPEN!  If you use them with any other file 
  2732.  handle you may damage other files opened by 4OS2 (or, in a secondary shell, 
  2733.  the program which started 4OS2), or hang your system. 
  2734.  
  2735.  Examples 
  2736.  
  2737.  You can use variable functions in a wide variety of ways depending on your 
  2738.  needs.  We've included a few examples below to give you an idea of what's 
  2739.  possible. 
  2740.  
  2741.  To set the prompt to show the amount of free memory (see PROMPT for details on 
  2742.  including variable functions in your prompt): 
  2743.  
  2744.           [c:\] prompt (%%@dosmem[K]K) $p$g
  2745.  
  2746.  Set up a simple command-line calculator.  The calculator is used with a 
  2747.  command like CALC 3 * (4 + 5): 
  2748.  
  2749.           [c:\] alias calc `echo The answer is:  %@eval[%&]`
  2750.  
  2751.  The following batch file uses variable functions to implement "once a day" 
  2752.  execution of a group of commands.  It works by constructing a 6-digit number 
  2753.  "yymmdd" from today's date, and comparing that to a number of the same type 
  2754.  stored in the file C:\ONCEADAY.DAT. If today's date is numerically larger than 
  2755.  the saved date, and the time is after 6:00 AM, then the "once a day" commands 
  2756.  are run, and today's date is saved in the file as the new date for comparison. 
  2757.  Otherwise, no action is taken.  You can make this file simpler using the 
  2758.  %@DATE and %@TIME functions instead of using %@SUBSTR to extract substrings of 
  2759.  the %_DATE and %_TIME variables; we used the approach shown to demonstrate the 
  2760.  use of %@SUBSTR. 
  2761.  
  2762.           rem  Temporary variables used to shorten example lines:
  2763.           rem    DD is _date, DY is yymmdd date, TM is _time
  2764.           set dd=%_date
  2765.           set dy=%@substr[%dd,6,2]%@substr[%dd,0,2]%@substr[%dd,3,2]
  2766.           set lastdate=0
  2767.           iff exist c:\onceaday.dat then
  2768.              set lastdate=%@line[onceaday.dat,0]
  2769.           endiff
  2770.           iff %dy gt %lastdate then
  2771.              set tm=%_time
  2772.              iff "%@substr[%tm,0,2]%@substr[%tm,3,2]" gt "0600" then
  2773.                 rem Commands to be executed once a day go here
  2774.                 echo %dy > c:\onceaday.dat
  2775.              endiff
  2776.           endiff
  2777.  
  2778.  
  2779. ΓòÉΓòÉΓòÉ 12.1. @ALIAS ΓòÉΓòÉΓòÉ
  2780.  
  2781. @ALIAS[name]:  Returns the contents of the specified alias as a string, or a 
  2782. null string if the alias doesn't exist.  When manipulating strings returned by 
  2783. @ALIAS you may need to disable certain special characters with the SETDOS /X 
  2784. command. Otherwise, command separators, redirection characters, and other 
  2785. similar "punctuation" in the alias may be interpreted as part of the current 
  2786. command, rather than part of a simple text string. 
  2787.  
  2788.  
  2789. ΓòÉΓòÉΓòÉ 12.2. @ASCII ΓòÉΓòÉΓòÉ
  2790.  
  2791. @ASCII[c]:  Returns the numeric value of the specified ASCII character as a 
  2792. string.  For example %@ASCII[A] returns 65.  You can put an escape character 
  2793. [^] before the actual character to process.  This allows quotes and other 
  2794. special characters as the argument (e.g., %@ASCII[^`]). 
  2795.  
  2796.  
  2797. ΓòÉΓòÉΓòÉ 12.3. @ATTRIB ΓòÉΓòÉΓòÉ
  2798.  
  2799. @ATTRIB[filename,nrhsda]:  Returns a "1" if the specified file has the matching 
  2800. attribute(s); otherwise returns a "0".  The attributes are: 
  2801.  
  2802.         N   Normal (no attributes set) 
  2803.         R   Read-only 
  2804.         H   Hidden 
  2805.         S   System 
  2806.         D   Directory 
  2807.         A   Archive 
  2808.  
  2809.  The attributes (other than N) can be combined (for example 
  2810.  %@ATTRIB[MYFILE,HS]).  ATTRIB will only return a 1 if all of the attributes 
  2811.  match. 
  2812.  
  2813.  
  2814. ΓòÉΓòÉΓòÉ 12.4. @CDROM ΓòÉΓòÉΓòÉ
  2815.  
  2816. @CDROM[d:]:  Returns "1" if the drive is a CD-ROM or "0" otherwise. 
  2817.  
  2818.  
  2819. ΓòÉΓòÉΓòÉ 12.5. @CHAR ΓòÉΓòÉΓòÉ
  2820.  
  2821. @CHAR[n]:  Returns the character corresponding to an ASCII numeric value.  For 
  2822. example %@CHAR[65] returns A. 
  2823.  
  2824.  
  2825. ΓòÉΓòÉΓòÉ 12.6. @DATE ΓòÉΓòÉΓòÉ
  2826.  
  2827. @DATE[mm-dd-yy]:  Returns the number of days since January 1, 1980 for the 
  2828. specified date.  DATE uses the date format and separators mandated by your 
  2829. country code (for example dd.mm.yy in Germany, or  yy-mm-dd in Japan). 
  2830.  
  2831.  
  2832. ΓòÉΓòÉΓòÉ 12.7. @DEC ΓòÉΓòÉΓòÉ
  2833.  
  2834. @DEC[%var]:  Returns the same value as @EVAL[%var - 1].  That is, it retrieves 
  2835. and decrements the value of a variable.  The variable itself is not changed; to 
  2836. do so, use a command like this: 
  2837.  
  2838.         set var=%@dec[%var]
  2839.  
  2840.  
  2841. ΓòÉΓòÉΓòÉ 12.8. @DESCRIPT ΓòÉΓòÉΓòÉ
  2842.  
  2843. @DESCRIPT[filename]:  Returns the file description for the specified filename 
  2844. (see DESCRIBE). 
  2845.  
  2846.  
  2847. ΓòÉΓòÉΓòÉ 12.9. @DEVICE ΓòÉΓòÉΓòÉ
  2848.  
  2849. @DEVICE[name]:  Returns "1" if the specified name is a character device (such 
  2850. as a printer or serial port), or "0" if not. 
  2851.  
  2852.  
  2853. ΓòÉΓòÉΓòÉ 12.10. @DISKFREE ΓòÉΓòÉΓòÉ
  2854.  
  2855. @DISKFREE[d:,b|k|m]: Returns the amount of free disk space on the specified 
  2856. drive. 
  2857.  
  2858.  
  2859. ΓòÉΓòÉΓòÉ 12.11. @DISKTOTAL ΓòÉΓòÉΓòÉ
  2860.  
  2861. @DISKTOTAL[d:,b|k|m]:  Returns the total disk space on the specified drive. 
  2862.  
  2863.  
  2864. ΓòÉΓòÉΓòÉ 12.12. @DISKUSED ΓòÉΓòÉΓòÉ
  2865.  
  2866. @DISKUSED[d:,b|k|m]:  Returns the amount of disk space in use by files and 
  2867. directories on the specified drive. 
  2868.  
  2869.  
  2870. ΓòÉΓòÉΓòÉ 12.13. @DOSMEM ΓòÉΓòÉΓòÉ
  2871.  
  2872. @DOSMEM[b|k|m]:  Returns the size of the largest free memory block (either in 
  2873. physical or virtual memory). 
  2874.  
  2875.  
  2876. ΓòÉΓòÉΓòÉ 12.14. @EVAL ΓòÉΓòÉΓòÉ
  2877.  
  2878. @EVAL[expression]:  Evaluates an arithmetic expression.  @EVAL supports 
  2879. addition (+), subtraction (-), multiplication (*), division (/), integer 
  2880. division (\, returns the integer part of the quotient), and modulo (%%).  The 
  2881. expression can contain environment variables and other variable functions. 
  2882. @EVAL also supports parentheses, commas, and decimals.  Parentheses can be 
  2883. nested.  The maximum precision is 16 digits to the left of the decimal point 
  2884. and 8 digits to the right of the decimal point.  @EVAL will strip leading and 
  2885. trailing zeros from the result.  When evaluating expressions, *, /, and %% take 
  2886. precedence over + and -.  For example, 3 + 4 * 2 will be interpreted as 3 + 8, 
  2887. not as 7 * 2.  To change this order of evaluation, use parentheses to specify 
  2888. the order you want.  Also see @DEC and @INC. 
  2889.  
  2890.  
  2891. ΓòÉΓòÉΓòÉ 12.15. @EXEC ΓòÉΓòÉΓòÉ
  2892.  
  2893. @EXEC[command]:  Execute the command and return the numeric exit code.  The 
  2894. command can be an alias, internal command, external command, .BTM file, or .BAT 
  2895. file.  @EXEC is primarily intended for running a program from within the 
  2896. PROMPT.  It is a "back door" entry into command processing and should be used 
  2897. with extreme caution.  Incorrect or recursive use of @EXEC may hang your 
  2898. system. 
  2899.  
  2900.  
  2901. ΓòÉΓòÉΓòÉ 12.16. @EXETYPE ΓòÉΓòÉΓòÉ
  2902.  
  2903. @EXETYPE[filename]:  Returns the application type as a string: 
  2904.  
  2905.         DOS         DOS .COM, .EXE, or .BAT file (OS/2 2.x only) 
  2906.         AVIO        OS/2 Character mode, windowed 
  2907.         FS          OS/2 Character mode, full-screen 
  2908.         PM          OS/2 Presentation Manager 
  2909.         WIN         Windows 3 (OS/2 2.x only) 
  2910.         UNKNOWN     Any other file 
  2911.  
  2912.  
  2913. ΓòÉΓòÉΓòÉ 12.17. @EXT ΓòÉΓòÉΓòÉ
  2914.  
  2915. @EXT[filename]:  Returns the extension from a file name, without a leading 
  2916. period. 
  2917.  
  2918.  
  2919. ΓòÉΓòÉΓòÉ 12.18. @FILEAGE ΓòÉΓòÉΓòÉ
  2920.  
  2921. @FILEAGE[filename]:  Returns the date and time of the file as a single numeric 
  2922. value.  The number can be used to compare the relative ages of two or more 
  2923. files. 
  2924.  
  2925.  
  2926. ΓòÉΓòÉΓòÉ 12.19. @FILECLOSE ΓòÉΓòÉΓòÉ
  2927.  
  2928. @FILECLOSE[n]:  Closes the file whose handle is "n."  You cannot close handles 
  2929. 0, 1 or 2.  Returns "0" if the file closed OK or "-1" if an error occurred.  Be 
  2930. sure to read the cautionary note about file functions under Variable Functions. 
  2931.  
  2932.  
  2933. ΓòÉΓòÉΓòÉ 12.20. @FILEDATE ΓòÉΓòÉΓòÉ
  2934.  
  2935. @FILEDATE[filename]:  Returns the date a file was last modified, in the default 
  2936. country format (mm-dd-yy for the US). 
  2937.  
  2938.  
  2939. ΓòÉΓòÉΓòÉ 12.21. @FILENAME ΓòÉΓòÉΓòÉ
  2940.  
  2941. @FILENAME[filename]:  Returns the name and extension of a file, without a path. 
  2942.  
  2943.  
  2944. ΓòÉΓòÉΓòÉ 12.22. @FILEOPEN ΓòÉΓòÉΓòÉ
  2945.  
  2946. @FILEOPEN[filename, read | write | append]:  Opens the file in the specified 
  2947. mode and returns the file handle as an integer.  Returns "-1" if the file 
  2948. cannot be opened.  Be sure to read the cautionary note about file functions 
  2949. under Variable Functions. 
  2950.  
  2951.  
  2952. ΓòÉΓòÉΓòÉ 12.23. @FILEREAD ΓòÉΓòÉΓòÉ
  2953.  
  2954. @FILEREAD[n]:  Reads a line from the file whose handle is "n."  Returns 
  2955. "**EOF**" if you attempt to read past the end of the file.  Be sure to read the 
  2956. cautionary note about file functions under Variable Functions. 
  2957.  
  2958.  
  2959. ΓòÉΓòÉΓòÉ 12.24. @FILES ΓòÉΓòÉΓòÉ
  2960.  
  2961. @FILES[filename]:  Returns the number of files that match the filename 
  2962. specification, which may contain wildcards and include lists.  The filename 
  2963. must refer to a single directory; to check several directories, use @FILES once 
  2964. for each directory, and add the results together with @EVAL. 
  2965.  
  2966.  
  2967. ΓòÉΓòÉΓòÉ 12.25. @FILESEEK ΓòÉΓòÉΓòÉ
  2968.  
  2969. @FILESEEK[n,offset,start]:  Moves the file pointer "offset" bytes in the file 
  2970. whose handle is "n".  Returns the new position of the pointer, in bytes from 
  2971. the start of the file.  Set "start" to 0 to seek relative to the beginning of 
  2972. the file, 1 to seek relative to the current file pointer, or 2 to seek relative 
  2973. to the end of the file.  The offset value may be negative (seek backward), 
  2974. positive (seek forward), or zero (return current position, but do not change 
  2975. it).  Be sure to read the cautionary note about file functions under Variable 
  2976. Functions. 
  2977.  
  2978.  
  2979. ΓòÉΓòÉΓòÉ 12.26. @FILESIZE ΓòÉΓòÉΓòÉ
  2980.  
  2981. @FILESIZE[filename,b|k|m]:  Returns the size of a file, or "-1" if the file 
  2982. does not exist.  If the filename includes wildcards or an include list, returns 
  2983. the combined size of all matching files. 
  2984.  
  2985.  
  2986. ΓòÉΓòÉΓòÉ 12.27. @FILETIME ΓòÉΓòÉΓòÉ
  2987.  
  2988. @FILETIME[filename]:  Returns the time a file was last modified, in hh:mm 
  2989. format. 
  2990.  
  2991.  
  2992. ΓòÉΓòÉΓòÉ 12.28. @FILEWRITE ΓòÉΓòÉΓòÉ
  2993.  
  2994. @FILEWRITE[n,text]:  Writes a line to the file whose handle is "n".  Returns 
  2995. the number of bytes written, or "-1" if an error occurred.  Be sure to read the 
  2996. cautionary note about file functions under Variable Functions. 
  2997.  
  2998.  
  2999. ΓòÉΓòÉΓòÉ 12.29. @FINDFIRST ΓòÉΓòÉΓòÉ
  3000.  
  3001. @FINDFIRST[filename [,nrhsda]]:  Returns the name of the first file that 
  3002. matches the filename, which may include wildcards.  The second argument, if 
  3003. included, defines the attributes of the files that will be included in the 
  3004. search.  Returns an empty string if no files match.  The attributes are: 
  3005.  
  3006.         N   Normal (no attributes set) 
  3007.         R   Read-only 
  3008.         H   Hidden 
  3009.         S   System 
  3010.         D   Directory 
  3011.         A   Archive 
  3012.  
  3013.  The attributes (other than N) can be combined (for example 
  3014.  %@FINDFIRST[MYFILE,HS]).  @FINDFIRST will only find a file if all of the 
  3015.  attributes match. 
  3016.  
  3017.  
  3018. ΓòÉΓòÉΓòÉ 12.30. @FINDNEXT ΓòÉΓòÉΓòÉ
  3019.  
  3020. @FINDNEXT[filename [,nrhsda]]:  Returns the name of the next file that matches 
  3021. the filename, which may include wildcards.  The second argument, if included, 
  3022. defines the attributes of the files that will be included in the search (see 
  3023. @FINDFIRST for details). Returns an empty string when no more files match. 
  3024. @FINDNEXT should only be used after a successful call to @FINDFIRST. 
  3025.  
  3026.  
  3027. ΓòÉΓòÉΓòÉ 12.31. @FSTYPE ΓòÉΓòÉΓòÉ
  3028.  
  3029. @FSTYPE[d:]:  Returns the file system type for the specified drive.  @FSTYPE 
  3030. will return "FAT" for a DOS-compatible drive with a file allocation table, 
  3031. "HPFS" for a drive that uses OS/2's high performance file system, or "CDFS" for 
  3032. a CD-ROM drive.  It may return other values if additional file systems have 
  3033. been installed with the IFS= directive in CONFIG.SYS. 
  3034.  
  3035.  
  3036. ΓòÉΓòÉΓòÉ 12.32. @FULL ΓòÉΓòÉΓòÉ
  3037.  
  3038. @FULL[filename]:  Returns the fully qualified path name of a file. 
  3039.  
  3040.  
  3041. ΓòÉΓòÉΓòÉ 12.33. @INC ΓòÉΓòÉΓòÉ
  3042.  
  3043. @INC[%var]:  Returns the same value as %@EVAL[%var + 1].  That is, it retrieves 
  3044. and increments the value of a variable.  The variable itself is not changed; to 
  3045. do so, use a command like this: 
  3046.  
  3047.         set var=%@inc[%var]
  3048.  
  3049.  
  3050. ΓòÉΓòÉΓòÉ 12.34. @INDEX ΓòÉΓòÉΓòÉ
  3051.  
  3052. @INDEX[string1,string2]:  Returns the position of string2 within string1, or 
  3053. "-1" if string2 is not found.  The first position in string1 is numbered 0. 
  3054.  
  3055.  
  3056. ΓòÉΓòÉΓòÉ 12.35. @INSTR ΓòÉΓòÉΓòÉ
  3057.  
  3058. @INSTR[start, length, string]:  The same as @SUBSTR.  However, the string is at 
  3059. the end of the @INSTR argument list, so that commas in the string will not be 
  3060. confused with commas separating the arguments. 
  3061.  
  3062.  
  3063. ΓòÉΓòÉΓòÉ 12.36. @INT ΓòÉΓòÉΓòÉ
  3064.  
  3065. @INT[n]:  Returns the integer part of the number n. 
  3066.  
  3067.  
  3068. ΓòÉΓòÉΓòÉ 12.37. @LABEL ΓòÉΓòÉΓòÉ
  3069.  
  3070. @LABEL[d:]:  Returns the volume label of the specified disk drive. 
  3071.  
  3072.  
  3073. ΓòÉΓòÉΓòÉ 12.38. @LEN ΓòÉΓòÉΓòÉ
  3074.  
  3075. @LEN[string]:  Returns the length of a string. 
  3076.  
  3077.  
  3078. ΓòÉΓòÉΓòÉ 12.39. @LINE ΓòÉΓòÉΓòÉ
  3079.  
  3080. @LINE[filename,n]:  Returns line "n" from the specified file. The first line in 
  3081. the file is numbered 0.  "**EOF**" is returned for all line numbers beyond the 
  3082. end of the file.  If you need to scan through the lines of a file in sequence, 
  3083. the @FILEREAD function (above) and the "@filename" construct available in the 
  3084. FOR command are much faster than calling the @LINE function repeatedly.  @LINE 
  3085. will retrieve input from standard input if you specify CON as the filename.  If 
  3086. you are redirecting input to @LINE using this feature, you must use command 
  3087. grouping or the redirection will not work properly.  For example: 
  3088.  
  3089.         (echo %@line[con,0]) < myfile.dat
  3090.  
  3091.  
  3092. ΓòÉΓòÉΓòÉ 12.40. @LINES ΓòÉΓòÉΓòÉ
  3093.  
  3094. @LINES[filename]:  Returns the line number of the last line in the file, or 
  3095. "-1" if the file is empty.  The first line in the file is numbered 0, so (for 
  3096. example) @LINES will return 0 for a file containing one line. 
  3097.  
  3098.  
  3099. ΓòÉΓòÉΓòÉ 12.41. @LOWER ΓòÉΓòÉΓòÉ
  3100.  
  3101. @LOWER[string]:  Returns the string converted to lower case. 
  3102.  
  3103.  
  3104. ΓòÉΓòÉΓòÉ 12.42. @MAKEDATE ΓòÉΓòÉΓòÉ
  3105.  
  3106. @MAKEDATE[n]:  Returns a date (formatted according to the current country 
  3107. settings).  "n" is the number of days since 1/1/80. This is the inverse of 
  3108. @DATE. 
  3109.  
  3110.  
  3111. ΓòÉΓòÉΓòÉ 12.43. @MAKETIME ΓòÉΓòÉΓòÉ
  3112.  
  3113. @MAKETIME[n]:  Returns a time (formatted according to the current country 
  3114. settings).  "n" is the number of seconds since midnight.  This is the inverse 
  3115. of @TIME. 
  3116.  
  3117.  
  3118. ΓòÉΓòÉΓòÉ 12.44. @NAME ΓòÉΓòÉΓòÉ
  3119.  
  3120. @NAME[filename]:  Returns the base name of a file, without the path or 
  3121. extension. 
  3122.  
  3123.  
  3124. ΓòÉΓòÉΓòÉ 12.45. @NUMERIC ΓòÉΓòÉΓòÉ
  3125.  
  3126. @NUMERIC[string]:  Returns "1" if the argument is composed entirely of digits 
  3127. (0 to 9), signs (+ or -), and the thousands and decimal separators.  Otherwise, 
  3128. returns "0". 
  3129.  
  3130.  
  3131. ΓòÉΓòÉΓòÉ 12.46. @PATH ΓòÉΓòÉΓòÉ
  3132.  
  3133. @PATH[filename]:  Returns the path from a file name, including the drive letter 
  3134. and a trailing backslash but not including the base name or extension. 
  3135.  
  3136.  
  3137. ΓòÉΓòÉΓòÉ 12.47. @RANDOM ΓòÉΓòÉΓòÉ
  3138.  
  3139. @RANDOM[min, max]:  Returns a random value between min and max, inclusive. 
  3140. Min, max, and the returned value are all integers. 
  3141.  
  3142.  
  3143. ΓòÉΓòÉΓòÉ 12.48. @READSCR ΓòÉΓòÉΓòÉ
  3144.  
  3145. @READSCR[row,col,length]:  Returns the text displayed on the screen at the 
  3146. specified location.  The upper left corner of the screen is location 0,0. 
  3147.  
  3148.  
  3149. ΓòÉΓòÉΓòÉ 12.49. @READY ΓòÉΓòÉΓòÉ
  3150.  
  3151. @READY[d:]:  Returns "1" if the specified drive is ready; otherwise returns 
  3152. "0". 
  3153.  
  3154.  
  3155. ΓòÉΓòÉΓòÉ 12.50. @REMOTE ΓòÉΓòÉΓòÉ
  3156.  
  3157. @REMOTE[d:]:  Returns "1" if the specified drive is a remote (network) drive; 
  3158. otherwise returns "0". 
  3159.  
  3160.  
  3161. ΓòÉΓòÉΓòÉ 12.51. @REMOVABLE ΓòÉΓòÉΓòÉ
  3162.  
  3163. @REMOVABLE[d:]:  Returns "1" if the specified drive is removable (i.e., a 
  3164. floppy disk or removable hard disk); otherwise returns "0". 
  3165.  
  3166.  
  3167. ΓòÉΓòÉΓòÉ 12.52. @REPEAT ΓòÉΓòÉΓòÉ
  3168.  
  3169. @REPEAT[c,n]:  Returns the character "c" repeated "n" times. 
  3170.  
  3171.  
  3172. ΓòÉΓòÉΓòÉ 12.53. @SEARCH ΓòÉΓòÉΓòÉ
  3173.  
  3174. @SEARCH[filename]:  Searches for the filename using the PATH environment 
  3175. variable, appending an extension if one isn't specified.  Returns the 
  3176. fully-expanded name of the file including drive, path, base name, and 
  3177. extension, or an empty string if a matching file is not found.  If wildcards 
  3178. are used in the filename, @SEARCH will search for the first file that matches 
  3179. the wildcard specification, and return the drive and path for that file plus 
  3180. the wildcard filename (e.g., E:\UTIL\*.COM ). 
  3181.  
  3182.  
  3183. ΓòÉΓòÉΓòÉ 12.54. @SELECT ΓòÉΓòÉΓòÉ
  3184.  
  3185. @SELECT[filename,top,left,bottom,right,title]:  Pops up a selection window with 
  3186. the lines from the specified file. Returns the text of the line the scrollbar 
  3187. is on if you press Enter, or an empty string if you press Esc.  @SELECT can be 
  3188. used to display menus or other selection lists from a batch file.  To select 
  3189. from lines passed through input redirection or a pipe, use CON as the filename. 
  3190. You can move through the selection window with standard navigation keystrokes. 
  3191. To change the navigation keys, see the Key Mapping directives in the .INI file. 
  3192.  
  3193.  
  3194. ΓòÉΓòÉΓòÉ 12.55. @SUBSTR ΓòÉΓòÉΓòÉ
  3195.  
  3196. @SUBSTR[string,start,length]:  Returns a substring, starting at the position 
  3197. "start" and continuing for "length" characters.  If the length is omitted, it 
  3198. will default to the remainder of the string.  If the length is negative, the 
  3199. start is relative to the right side of the string.  The first character in the 
  3200. string is numbered 0; if the length is negative, the last character is numbered 
  3201. 0.  For example, %@SUBSTR[%_TIME,0,2] gets the current time and extracts the 
  3202. hour.  If the string includes commas, it must be quoted with double quotes ["] 
  3203. or back quotes [`].  The quotes do count in calculating the position of the 
  3204. substring. @INSTR performs the same function, and allows commas in the string 
  3205. without quoting. 
  3206.  
  3207.  
  3208. ΓòÉΓòÉΓòÉ 12.56. @TIME ΓòÉΓòÉΓòÉ
  3209.  
  3210. @TIME[hh:mm:ss]:  Returns the number of seconds since midnight for the 
  3211. specified time.  The time must be in 24-hour format; "am" and "pm" cannot be 
  3212. used. 
  3213.  
  3214.  
  3215. ΓòÉΓòÉΓòÉ 12.57. @TRIM ΓòÉΓòÉΓòÉ
  3216.  
  3217. @TRIM[string]:  Returns the string with the leading and trailing white space 
  3218. (space and tab characters) removed. 
  3219.  
  3220.  
  3221. ΓòÉΓòÉΓòÉ 12.58. @UNIQUE ΓòÉΓòÉΓòÉ
  3222.  
  3223. @UNIQUE[d:\path]:  Creates a zero-length file with a unique name in the 
  3224. specified directory, and returns the full name and path.  If no path is 
  3225. specified, the file will be created in the current directory.  The file name 
  3226. will be FAT-compatible (8 character name and 3-character extension) regardless 
  3227. of whether the file is created on a FAT or HPFS drive.  This function allows 
  3228. you to create a  temporary file without overwriting an existing file. 
  3229.  
  3230.  
  3231. ΓòÉΓòÉΓòÉ 12.59. @UPPER ΓòÉΓòÉΓòÉ
  3232.  
  3233. @UPPER[string]:  Returns the string converted to upper case. 
  3234.  
  3235.  
  3236. ΓòÉΓòÉΓòÉ 12.60. @WORD ΓòÉΓòÉΓòÉ
  3237.  
  3238. @WORD[n,string]:  Returns the "nth" word in a string.  The first word is 
  3239. numbered 0.  If "n" is negative, words are returned from the end of the string. 
  3240. Only spaces, tabs, and commas are considered to be word separators.  For 
  3241. example: 
  3242.  
  3243.         %@WORD[2,NOW IS THE TIME]     returns "THE"
  3244.         %@WORD[-0,NOW IS THE TIME]    returns "TIME"
  3245.         %@WORD[-2,NOW IS THE TIME]    returns "IS"
  3246.  
  3247.  
  3248. ΓòÉΓòÉΓòÉ 13. 4OS2.INI ΓòÉΓòÉΓòÉ
  3249.  
  3250. The configuration of 4OS2 is controlled through an optional file of 
  3251. initialization information called 4OS2.INI. 
  3252.  
  3253. This section contains general information on 4OS2.INI, and an example. For 
  3254. information on specific directives see the separate topic for each type of 
  3255. directive: 
  3256.  
  3257.             Initialization Directives 
  3258.             Configuration Directives 
  3259.             Color Directives 
  3260.             Key Mapping Directives 
  3261.             Advanced Directives 
  3262.  
  3263.  These topics list the directives, with a one-line description of each, and a 
  3264.  cross-reference which selects a full screen help topic on that directive. A 
  3265.  few of the directives are simple enough that the one-line description is 
  3266.  sufficient, but in most cases you should check for any additional information 
  3267.  in the cross-reference topic if you are not already familiar with the 
  3268.  directive. 
  3269.  
  3270.  You can also obtain help on most directives with a HELP directive command at 
  3271.  the prompt. 
  3272.  
  3273.  You can create, add to, and edit the .INI file with any ASCII text editor. 
  3274.  Each command processor reads its .INI file when it starts, and configures 
  3275.  itself accordingly.  The .INI file is not re-read when you change it.  For 
  3276.  changes to take effect, you must restart the session or window in which 4OS2 
  3277.  is running. 
  3278.  
  3279.  Each item that you can include in the .INI file has a default value.  You only 
  3280.  need to include entries in the file for settings that you want to change from 
  3281.  their default values.  If you are happy with all of the default values, you 
  3282.  don't need an .INI file at all. 
  3283.  
  3284.  4OS2 primary shells search for the .INI file in three places: 
  3285.  
  3286.         *   If there is an "@d:\path\inifile" option on the 4OS2 startup 
  3287.             command liine 4OS2 will use the path and file name specified there, 
  3288.             and will not look elsewhere. 
  3289.         *   If there is no .INI file name on the startup command line, the 
  3290.             search proceeds to the same directory where the 4OS2 program file 
  3291.             (4OS2.EXE ) is stored.  This is the "normal" location for the .INI 
  3292.             file.  4OS2 determines this directory automatically.  You can also 
  3293.             set it yourself by placing a COMSPEC directory name on the startup 
  3294.             command line. 
  3295.         *   If the .INI file is not found in the directory where the program 
  3296.             file is stored, a final check is made in the root directory of the 
  3297.             boot drive. 
  3298.  
  3299.  When 4OS2 is loaded as a secondary shell, it does not search for the .INI 
  3300.  file.  Instead, it retrieves the primary shell's .INI file data, processes the 
  3301.  [Secondary] section of the original .INI file if necessary, and then processes 
  3302.  any "@d:\path\inifile" option on the secondary shell command line.  You can 
  3303.  override this behavior with the NextINIFile directive. 
  3304.  
  3305.  Most lines in the .INI file consist of a one-word directive, an equal sign 
  3306.  [=], and a value.  For example, in the following line, the word "History" is 
  3307.  the directive and "2048" is the value: 
  3308.  
  3309.           History = 2048
  3310.  
  3311.  Any spaces before or after the equal sign are ignored. 
  3312.  
  3313.  If you have a long string to enter in the .INI file (for example, for the 
  3314.  ColorDir directive), you must enter it all on one line.  Strings cannot be 
  3315.  "continued" to a second line.  Each line may be up to 1023 characters long. 
  3316.  
  3317.  The format of the value part of a directive line depends on the individual 
  3318.  directive.  It may be a numeric value, a single character, a choice (like 
  3319.  "Yes" or "No"), a color setting, a key name, a path, a filename, or a text 
  3320.  string.  The value begins with the first non-blank character after the equal 
  3321.  sign and ends at the end of the line or the beginning of a comment. 
  3322.  
  3323.  Blank lines are ignored in the .INI file and can be used to separate groups of 
  3324.  directives.  You can place comments in the file by beginning a line with a 
  3325.  semicolon [;].  You can also place comments at the end of any line except one 
  3326.  containing a text string value.  To do so, enter at least one space or tab 
  3327.  after the value, a semicolon, and your comment, like this: 
  3328.  
  3329.           History = 2048       ;set history list size
  3330.  
  3331.  If you try to place a comment at the end of a string value, the comment will 
  3332.  become part of the string and will probably cause an error. 
  3333.  
  3334.  When 4OS2 detects an error while processing the .INI file, it displays an 
  3335.  error message and prompts you to press a key to continue processing the file. 
  3336.  This allows you to note any errors before the startup process continues.  The 
  3337.  directive in error will retain its previous or default value.  Only the most 
  3338.  catastrophic errors (like a disk read failure) will terminate processing of 
  3339.  the remainder of the .INI file.  If you don't want a pause after each error, 
  3340.  use a PauseOnError = No directive at the beginning of the .INI file. 
  3341.  
  3342.  If you need to test different values for an .INI directive without repeatedly 
  3343.  editing the .INI file, see INIQuery. 
  3344.  
  3345.  The .INI file has three sections:  the first or global section, the [Primary] 
  3346.  section, and the [Secondary] section.  The global section consists of 
  3347.  directives at the beginning of the file, with no section name before them. 
  3348.  These directives are effective in all shells.  In most cases, this is the only 
  3349.  section you will need. 
  3350.  
  3351.  The [Primary] and [Secondary] sections include directives that are used in 
  3352.  primary and secondary shells respectively. Each section is identified by the 
  3353.  section name in square brackets on a line by itself.  You don't need to set up 
  3354.  these sections unless you want different directives for primary and secondary 
  3355.  shells. 
  3356.  
  3357.  Directives in the [Primary] section are used for the first or primary shell. 
  3358.  The values are passed automatically to all secondary shells, unless overridden 
  3359.  by a directive with the same name in the [Secondary] section. 
  3360.  
  3361.  Directives in the [Secondary] section are used in secondary shells only, and 
  3362.  override any corresponding primary shell settings. 
  3363.  
  3364.  Sections that begin with any name other than [Primary] or [Secondary] are 
  3365.  ignored. 
  3366.  
  3367.  The SETDOS command can override several of the .INI file directives.  For 
  3368.  example, the cursor shape used by 4OS2 can be adjusted either with the 
  3369.  CursorIns and CursorOver directives or the SETDOS /S command.  The 
  3370.  correspondence between SETDOS options and .INI directives is noted under each 
  3371.  directive below, and under each option of the SETDOS command. 
  3372.  
  3373.  This example configures certain special characters to match 4DOS, and changes 
  3374.  other default settings to suit the user's preferences.  All of these settings 
  3375.  except HelpBook would also work in 4DOS or 4DOS/NT. Note that the comments for 
  3376.  the HelpBook and ColorDir directives are on separate lines before the 
  3377.  directives themselves, as no comments are allowed in string directives: 
  3378.  
  3379.           PauseOnError = No             ;don't stop on INI errors
  3380.           CommandSep = ^                ;4DOS command separator
  3381.           ParameterChar = &             ;4DOS parameter character
  3382.           BatchEcho = No                ;default to ECHO OFF
  3383.                                         ;show only 4OS2 help for F1 / HELP
  3384.           HelpBook = 4OS2
  3385.           History = 2048                ;expand history to 2K bytes
  3386.           BeepFreq = 880                ;make beep higher pitch
  3387.           EditMode = Insert             ;insert mode for cmd edit
  3388.           CursorOver = 100              ;overstrike cursor 100%
  3389.           CursorIns = 10                ;insert cursor 10%
  3390.           ListFind = F5                 ;F5 does a find in LIST
  3391.           ListNext = F6                 ;and F6 does a find next
  3392.           StdColors = bri cya on blu    ;default colors
  3393.           ListColors = bri whi on blu   ;colors for LIST
  3394.           SelectColors = bri whi on blu ;same colors for SELECT
  3395.                                         ;set directory display colors
  3396.           colordir = DIRS:bri yel;com exe bat btm cmd:bri whi
  3397.  
  3398.  
  3399. ΓòÉΓòÉΓòÉ 13.1. Initialization Directives ΓòÉΓòÉΓòÉ
  3400.  
  3401. The directives in this section control how 4OS2 starts and where it looks for 
  3402. its files.  The initialization directives are: 
  3403.  
  3404.         4StartPath          Path for 4START and 4EXIT 
  3405.         HelpBook            Books to load in help system 
  3406.         History             Size of history list 
  3407.         INIQuery            Query for each line in 4OS2.INI 
  3408.         LocalAliases        Local vs. global aliases 
  3409.         LocalHistory        Local vs. global history 
  3410.         PauseOnError        Pause on errors in 4OS2.INI 
  3411.         WindowState         Initial state for the 4OS2 window 
  3412.         WindowX, WindowY, WindowWidth, WindowHeightInitial size and position of 
  3413.                             the 4OS2 window 
  3414.  
  3415.  
  3416. ΓòÉΓòÉΓòÉ 13.1.1. 4StartPath ΓòÉΓòÉΓòÉ
  3417.  
  3418. 4StartPath = Path:  Sets the drive and directory where the 4START and 4EXIT 
  3419. batch files (if any) are located. 
  3420.  
  3421.  
  3422. ΓòÉΓòÉΓòÉ 13.1.2. HelpBook ΓòÉΓòÉΓòÉ
  3423.  
  3424. HelpBook = String:  Sets the names of the "books" to be loaded when 4OS2 help 
  3425. is invoked with the HELP command or the F1 key.  The default is 4OS2+CMDREF 
  3426. which loads the 4OS2 help and the OS/2 command reference. 
  3427.  
  3428.  
  3429. ΓòÉΓòÉΓòÉ 13.1.3. History ΓòÉΓòÉΓòÉ
  3430.  
  3431. History = nnnn (1024):  Sets the amount of memory allocated to the command 
  3432. history list in bytes.  The allowable range of values is 256 to 8192 bytes.  If 
  3433. you use a global history list (see Command History and Recall), the History 
  3434. value is ignored in all shells except the shell which first establishes the 
  3435. global list. 
  3436.  
  3437.  
  3438. ΓòÉΓòÉΓòÉ 13.1.4. INIQuery ΓòÉΓòÉΓòÉ
  3439.  
  3440. INIQuery = Yes | NO:  If set to Yes, a prompt will be displayed before 
  3441. execution of each subsequent line in the current .INI file.  This allows you to 
  3442. modify certain directives when you start 4OS2 in order to test different 
  3443. configurations.  INIQuery can be reset to No at any point in the file. 
  3444. Normally INIQuery = Yes is only used during testing of other .INI file 
  3445. directives. 
  3446.  
  3447. The prompt generated by INIQuery = Yes is: 
  3448.  
  3449.         [contents of the line]  (Y/N/Q/R/E)  ?
  3450.  
  3451. At this prompt, you may enter: 
  3452.  
  3453.         Y = Yes:    Process this line and go on to the next. 
  3454.         N = No:     Skip this line and go on to the next. 
  3455.         Q = Quit:   Skip this line and all subsequent lines. 
  3456.         R = Rest:   Execute this and all subsequent lines. 
  3457.         E = Edit:   Edit the value for this entry. 
  3458.  
  3459.  If you choose E for Edit, you can enter a new value for the directive, but not 
  3460.  a new directive name. 
  3461.  
  3462.  For example, if you have found a compatibility problem you think may be 
  3463.  related to 4OS2's character (as opposed to line) input mode, you might change 
  3464.  your 4OS2.INI file so a part of it read as follows: 
  3465.  
  3466.           INIQuery = Yes
  3467.           LineInput = Yes
  3468.           INIQuery = No
  3469.  
  3470.  You could then choose to process, ignore, or edit the LineInput directive each 
  3471.  time 4OS2 started.  This would allow you to check whether changing the line 
  3472.  input mode would resolve the compatibility problem. 
  3473.  
  3474.  
  3475. ΓòÉΓòÉΓòÉ 13.1.5. LocalAliases ΓòÉΓòÉΓòÉ
  3476.  
  3477. LocalAliases = Yes | NO:  No forces all copies of 4OS2 to share the same alias 
  3478. list.  Yes keeps the lists for each shell separate.  See ALIAS for more details 
  3479. on local and global alias lists. 
  3480.  
  3481.  
  3482. ΓòÉΓòÉΓòÉ 13.1.6. LocalHistory ΓòÉΓòÉΓòÉ
  3483.  
  3484. LocalHistory = Yes | NO:  No forces all copies of 4OS2 to share the same 
  3485. history list.  Yes keeps the lists for each shell separate.  See Command 
  3486. History and Recall for more details on local and global history lists. 
  3487.  
  3488.  
  3489. ΓòÉΓòÉΓòÉ 13.1.7. PauseOnError ΓòÉΓòÉΓòÉ
  3490.  
  3491. PauseOnError = YES | No:  Yes forces a pause with the message "Error in 
  3492. filename, press any key to continue processing" after displaying any error 
  3493. message related to a specific line in the .INI file.  No continues processing 
  3494. with no pause after an error message is displayed. 
  3495.  
  3496.  
  3497. ΓòÉΓòÉΓòÉ 13.1.8. WindowState ΓòÉΓòÉΓòÉ
  3498.  
  3499. WindowState = STANDARD | Maximize | Minimize:  Sets the initial state of the 
  3500. 4OS2 window.  Standard puts the window in the default position on the OS/2 
  3501. desktop, and is the default setting. Maximize maximizes the window; Minimize 
  3502. minimizes it.  If you use Maximize or Minimize, you may see the 4OS2 window 
  3503. appear briefly in the Standard position as it is created by OS/2, then switch 
  3504. to the new state. 
  3505.  
  3506.  
  3507. ΓòÉΓòÉΓòÉ 13.1.9. WindowX, WindowY, WindowWidth, WindowHeight ΓòÉΓòÉΓòÉ
  3508.  
  3509. WindowX = nnnn, WindowY = nnnn, WindowWidth = nnnn, WindowHeight = nnnn:  These 
  3510. 4 directives set the initial size and position of the 4OS2 window.  The 
  3511. measurements are in pixels or pels.  WindowX and WindowY refer to the position 
  3512. of the bottom left corner of the window relative to the bottom left corner of 
  3513. the screen. 
  3514.  
  3515.  
  3516. ΓòÉΓòÉΓòÉ 13.2. Configuration Directives ΓòÉΓòÉΓòÉ
  3517.  
  3518. These directives control the way that 4OS2 operate.  Some can be changed with 
  3519. the SETDOS command while 4OS2 is running. Any corresponding SETDOS command is 
  3520. listed in the description of each directive.  The configuration directives are: 
  3521.  
  3522.         AmPm                Time display format 
  3523.         BatchEcho           Default batch file echo state 
  3524.         BeepFreq            Default beep frequency 
  3525.         BeepLength          Default beep length 
  3526.         CommandSep          Multiple command separator character 
  3527.         CursorIns           Cursor shape in insert mode 
  3528.         CursorOver          Cursor shape in overstrike mode 
  3529.         DescriptionMax      Maximum length of file descriptions 
  3530.         Descriptions        Enable / disable description processing 
  3531.         EditMode            Editing mode (insert / overstrike) 
  3532.         EscapeChar          4OS2 escape character 
  3533.         HistCopy            History copy mode 
  3534.         HistLogName         History log file name 
  3535.         HistMin             Minimum command length to save 
  3536.         HistWinColors       History window colors 
  3537.         HistWinHeight       History window height 
  3538.         HistWinLeft         History window left side position 
  3539.         HistWinTop          History window top position 
  3540.         HistWinWidth        History window width 
  3541.         LineInput           Enable / disable line input mode 
  3542.         LogName             Log file name 
  3543.         NoClobber           Overwrite protection for output redirection 
  3544.         ParameterChar       Alias / batch file parameter character 
  3545.         Printer             LIST print device 
  3546.         ScreenRows          Screen height 
  3547.         UpperCase           Force file names to upper case 
  3548.  
  3549.  
  3550. ΓòÉΓòÉΓòÉ 13.2.1. AmPm ΓòÉΓòÉΓòÉ
  3551.  
  3552. AmPm = Yes | NO | Auto:  Yes displays times in 12-hour format with a trailing 
  3553. "a" for AM or "p" for PM.  The default of No forces a display in 24-hour time 
  3554. format.  Auto formats the time according to the country code set for your 
  3555. system.  AmPm controls the time displays used by DIR and SELECT, in LOG files, 
  3556. and the output of the TIMER, DATE, and TIME commands.  It has no effect on 
  3557. %_TIME, %@MAKETIME, the $t and $T options of PROMPT, or date and time ranges. 
  3558.  
  3559.  
  3560. ΓòÉΓòÉΓòÉ 13.2.2. BatchEcho ΓòÉΓòÉΓòÉ
  3561.  
  3562. BatchEcho = YES | No:  Sets the default batch echo mode. Yes enables echoing of 
  3563. all batch file commands unless ECHO is explicitly set off in the batch file. 
  3564. No disables batch file echoing unless ECHO is explicitly set on.  Also see 
  3565. SETDOS /V. 
  3566.  
  3567.  
  3568. ΓòÉΓòÉΓòÉ 13.2.3. BeepFreq ΓòÉΓòÉΓòÉ
  3569.  
  3570. BeepFreq = nnnn (440):  Sets the default BEEP command frequency in Hz.  This is 
  3571. also the frequency for "error" beeps (for example, if you press an illegal 
  3572. key).  To disable all error beeps set this or BeepLength to 0.  If you do, the 
  3573. BEEP command will still be operable, but will not produce sound unless you 
  3574. explicitly specify the frequency and duration. 
  3575.  
  3576.  
  3577. ΓòÉΓòÉΓòÉ 13.2.4. BeepLength ΓòÉΓòÉΓòÉ
  3578.  
  3579. BeepLength = nnnn (2):  Sets the default BEEP length in system clock ticks 
  3580. (approximately 1/18 of a second per tick). BeepLength is also the default 
  3581. length for "error" beeps (for example, if you press an illegal key). 
  3582.  
  3583.  
  3584. ΓòÉΓòÉΓòÉ 13.2.5. CommandSep ΓòÉΓòÉΓòÉ
  3585.  
  3586. CommandSep = c:  This is the character used to separate multiple commands on 
  3587. the same line.  The default is the ampersand [&]. You cannot use any of the 
  3588. redirection characters (| > < ) or any of the whitespace characters (space, 
  3589. tab, comma, or equal sign).  Also see SETDOS /C, the %+ internal variable, and 
  3590. 4DOS, 4OS2, and 4DOS/NT Compatibility for information on using compatible 
  3591. command separators for two or more products. 
  3592.  
  3593.  
  3594. ΓòÉΓòÉΓòÉ 13.2.6. CursorIns ΓòÉΓòÉΓòÉ
  3595.  
  3596. CursorIns = nnnn (100):  This is the shape of the cursor for insert mode during 
  3597. command-line editing and all commands which accept line input (DESCRIBE, ESET, 
  3598. etc.).  The size is a percentage of the total character cell size, between 0% 
  3599. and 100%.  Because of the way video drivers map the cursor shape, you may not 
  3600. get a smooth progression in cursor shapes as CursorIns and CursorOver change. 
  3601. Also see SETDOS /S. 
  3602.  
  3603.  
  3604. ΓòÉΓòÉΓòÉ 13.2.7. CursorOver ΓòÉΓòÉΓòÉ
  3605.  
  3606. CursorOver = nnnn (15):  This is the shape of the cursor for overtype mode 
  3607. during command-line editing and all commands which accept line input.  The size 
  3608. is a percentage of the total character cell size, between 0% and 100%.  Also 
  3609. see SETDOS /S. 
  3610.  
  3611.  
  3612. ΓòÉΓòÉΓòÉ 13.2.8. DescriptionMax ΓòÉΓòÉΓòÉ
  3613.  
  3614. DescriptionMax = nnnn (40):  Controls the description length limit for 
  3615. DESCRIBE.  The allowable range is 20 to 200 characters. 
  3616.  
  3617.  
  3618. ΓòÉΓòÉΓòÉ 13.2.9. Descriptions ΓòÉΓòÉΓòÉ
  3619.  
  3620. Descriptions = YES | No:  Turns description handling on or off during the file 
  3621. processing commands COPY, DEL, MOVE, and REN.  If set to No, 4OS2 will not 
  3622. update the description file when files are moved, copied, deleted or renamed. 
  3623. Also see SETDOS /D. 
  3624.  
  3625.  
  3626. ΓòÉΓòÉΓòÉ 13.2.10. EditMode ΓòÉΓòÉΓòÉ
  3627.  
  3628. EditMode = Insert | OVERSTRIKE:  This directive lets you start the command-line 
  3629. editor in either insert or overstrike mode.  Also see SETDOS /M. 
  3630.  
  3631.  
  3632. ΓòÉΓòÉΓòÉ 13.2.11. EscapeChar ΓòÉΓòÉΓòÉ
  3633.  
  3634. EscapeChar = c :  Sets the character used to suppress the normal meaning of the 
  3635. following character.  The default is a caret [^]. See Escape Character for a 
  3636. description of special escape sequences.  You cannot use any of the redirection 
  3637. characters (|, >, or < ) or the whitespace characters (space, tab, comma, or 
  3638. equal sign) as the escape character.  Also see SETDOS /E, the %= internal 
  3639. variable, and 4DOS, 4OS2, and 4DOS/NT Compatibility for information on using 
  3640. compatible escape characters for two or more products. 
  3641.  
  3642.  
  3643. ΓòÉΓòÉΓòÉ 13.2.12. HistCopy ΓòÉΓòÉΓòÉ
  3644.  
  3645. HistCopy = Yes | NO:  Controls what happens when you re-execute a line from the 
  3646. command history.  If this option is set to Yes, the line is appended to the end 
  3647. of the history list.  By default, or if this option is set to No, no copy of 
  3648. the command is made.  The original copy of the command is always retained at 
  3649. its original position in the list, regardless of the setting of HistCopy. 
  3650.  
  3651.  
  3652. ΓòÉΓòÉΓòÉ 13.2.13. HistLogName ΓòÉΓòÉΓòÉ
  3653.  
  3654. HistLogName = File:  Sets the history log file name and path.  Using 
  3655. HistLogName does not turn history logging on; you must use a LOG /H ON command 
  3656. to do so. 
  3657.  
  3658.  
  3659. ΓòÉΓòÉΓòÉ 13.2.14. HistMin ΓòÉΓòÉΓòÉ
  3660.  
  3661. HistMin = nnnn (0):  Sets the minimum command-line size to save in the command 
  3662. history list.  Any command line whose length is less than this value will not 
  3663. be saved.  Legal values range from 0, which saves everything, to 1024, which 
  3664. disables all command history saves. 
  3665.  
  3666.  
  3667. ΓòÉΓòÉΓòÉ 13.2.15. HistWinColors ΓòÉΓòÉΓòÉ
  3668.  
  3669. HistWinColors = Color:  Sets the default colors for the command- line and 
  3670. directory history windows.  If this directive is not used the colors will be 
  3671. reversed from the current colors on the screen. 
  3672.  
  3673.  
  3674. ΓòÉΓòÉΓòÉ 13.2.16. HistWinHeight ΓòÉΓòÉΓòÉ
  3675.  
  3676. HistWinHeight = nn (12):  Sets the height of the command-line and directory 
  3677. history windows in lines, including the border.  Legal values range from 5 to 
  3678. the height of your screen.  Any value which would cause the bottom of the 
  3679. window to be off the screen will be adjusted so that the entire window remains 
  3680. on the screen. 
  3681.  
  3682.  
  3683. ΓòÉΓòÉΓòÉ 13.2.17. HistWinLeft ΓòÉΓòÉΓòÉ
  3684.  
  3685. HistWinLeft = nn (40):  Sets the horizontal position of the left side of the 
  3686. command-line and directory history windows.  Legal values range from 0 (the 
  3687. left edge of the screen) to the number of columns on your screen minus 10.  Any 
  3688. value which would cause the right side of a minimum-width window to be off the 
  3689. screen will be adjusted so that the entire window remains on the screen. 
  3690.  
  3691.  
  3692. ΓòÉΓòÉΓòÉ 13.2.18. HistWinTop ΓòÉΓòÉΓòÉ
  3693.  
  3694. HistWinTop = nn (1):  Sets the vertical position of the top of the command-line 
  3695. and directory history windows.  Legal values range from 0 (the top of the 
  3696. screen) to the number of rows on your screen minus 5.  Any value which would 
  3697. cause the bottom of a minimum- height window to be off the screen will be 
  3698. adjusted so that the entire window remains on the screen. 
  3699.  
  3700.  
  3701. ΓòÉΓòÉΓòÉ 13.2.19. HistWinWidth ΓòÉΓòÉΓòÉ
  3702.  
  3703. HistWinWidth = nn (36):  Sets the width of the command-line and directory 
  3704. history windows in characters, including the border. Legal values range from 10 
  3705. to the width of your screen.  Any value which would cause the right side of the 
  3706. window to be off the screen will be adjusted so that the entire window remains 
  3707. on the screen. 
  3708.  
  3709.  
  3710. ΓòÉΓòÉΓòÉ 13.2.20. LineInput ΓòÉΓòÉΓòÉ
  3711.  
  3712. LineInput = Yes | NO:  This directive controls how 4OS2 gets its input from the 
  3713. command line.  Yes forces 4OS2 to perform line-by-line input, just as CMD.EXE 
  3714. does, instead of character-by-character input.  This will disable command-line 
  3715. editing, history recall, the directory history window, and filename completion, 
  3716. and will reduce the 4OS2 input length limit from 1023 characters to 299 
  3717. characters.  It is normally used only for applications which do not work 
  3718. properly unless 4OS2 uses line input.  If you have a particular program that 
  3719. requires line input, you can use SETDOS /L to temporarily change modes.  See 
  3720. README.DOC for information on programs which require this option. 
  3721.  
  3722.  
  3723. ΓòÉΓòÉΓòÉ 13.2.21. LogName ΓòÉΓòÉΓòÉ
  3724.  
  3725. LogName = File:  Sets the log file name and path.  Using LogName does not turn 
  3726. logging on; you must use a LOG ON command to do so. 
  3727.  
  3728.  
  3729. ΓòÉΓòÉΓòÉ 13.2.22. NoClobber ΓòÉΓòÉΓòÉ
  3730.  
  3731. NoClobber = Yes | NO:  If set to Yes, will prevent standard output redirection 
  3732. from overwriting an existing file, and will require that the output file 
  3733. already exist for append redirection.  Also see SETDOS /N. 
  3734.  
  3735.  
  3736. ΓòÉΓòÉΓòÉ 13.2.23. ParameterChar ΓòÉΓòÉΓòÉ
  3737.  
  3738. ParameterChar = c:  Sets the character used after a percent sign to specify all 
  3739. or all remaining command-line arguments in a batch file or alias (e.g., %& or 
  3740. %n&; see Batch Files and ALIAS).  The default is the ampersand [&].  Also see 
  3741. SETDOS /P.  See 4DOS, 4OS2, and 4DOS/NT Compatibility for information on using 
  3742. compatible parameter characters for two or more products.. 
  3743.  
  3744.  
  3745. ΓòÉΓòÉΓòÉ 13.2.24. Printer ΓòÉΓòÉΓòÉ
  3746.  
  3747. Printer = devicename:  Sets the output device that the LIST command will print 
  3748. to.  By default, LPT1 is used. The device can be PRN, LPT1 to 3, COM1 to 4, NUL 
  3749. (which will disable printed output) or any other installed character device. 
  3750.  
  3751.  
  3752. ΓòÉΓòÉΓòÉ 13.2.25. ScreenRows ΓòÉΓòÉΓòÉ
  3753.  
  3754. ScreenRows = nnnn:  Sets the number of screen rows used by the video display. 
  3755. Normally the screen size is determined automatically, but if you have a 
  3756. non-standard display you may need to set it explicitly.  This value does not 
  3757. affect screen scrolling, which is controlled by OS/2 and your video driver. 
  3758. ScreenRows is used only by the LIST and SELECT commands, the paged output 
  3759. options of other commands (e.g., TYPE /P), and error checking in the screen 
  3760. output commands.  Also see SETDOS /R. 
  3761.  
  3762.  
  3763. ΓòÉΓòÉΓòÉ 13.2.26. UpperCase ΓòÉΓòÉΓòÉ
  3764.  
  3765. UpperCase = Yes | NO:  Yes specifies that filenames should be displayed in the 
  3766. traditional upper-case by internal commands like COPY and DIR.  No allows the 
  3767. normal 4OS2 lower-case style. This directive does not affect the display of 
  3768. filenames on HPFS drives.  Also see SETDOS /U. 
  3769.  
  3770.  
  3771. ΓòÉΓòÉΓòÉ 13.3. Color Directives ΓòÉΓòÉΓòÉ
  3772.  
  3773. These directives control the colors that 4OS2 use for its displays. Screen 
  3774. border colors can only be set in StdColors.  "BORder" color specifications 
  3775. included in other directives will be ignored.  For complete details on color 
  3776. names see Colors and Color Names.  The color directives are: 
  3777.  
  3778.         BrightBG                Bright background colors 
  3779.         ColorDir                Directory colors 
  3780.         InputColors             Input colors 
  3781.         ListColors              LIST display colors 
  3782.         ListStatBarColors       LIST status bar colors 
  3783.         SelectColors            SELECT display colors 
  3784.         SelectStatBarColors     SELECT status bar colors 
  3785.         StdColors               Standard display colors 
  3786.  
  3787.  
  3788. ΓòÉΓòÉΓòÉ 13.3.1. BrightBG ΓòÉΓòÉΓòÉ
  3789.  
  3790. BrightBG = Yes | No.  If set to Yes, 4OS2 will enable bright background colors 
  3791. in full-screen sessions.  If set to No, bright backgrounds will be disabled but 
  3792. blinking foreground characters will be enabled.  If BrightBG is not used, 4OS2 
  3793. will not adjust the bright background / blinking foreground switch at all. 
  3794. Most color video boards default to a blinking foreground with bright background 
  3795. colors disabled.  See also SETDOS /B. 
  3796.  
  3797. Using BrightBG requires careful attention to interactions of display type, 
  3798. mode, and color.  For a detailed explanation, see Colors and Color Names. 
  3799.  
  3800.  
  3801. ΓòÉΓòÉΓòÉ 13.3.2. ColorDir ΓòÉΓòÉΓòÉ
  3802.  
  3803. ColorDir = ext1 ext2 ...:colora;ext3 ext4 ... :colorb; ...: Sets the directory 
  3804. colors used by DIR and SELECT.  The format is the same as that used for the 
  3805. COLORDIR environment variable.  See Color-Coded Directories for a detailed 
  3806. explanation. 
  3807.  
  3808.  
  3809. ΓòÉΓòÉΓòÉ 13.3.3. InputColors ΓòÉΓòÉΓòÉ
  3810.  
  3811. InputColors = Color:  Sets the colors used for command-line input.  This 
  3812. setting is useful for making your input stand out from the normal output. 
  3813.  
  3814.  
  3815. ΓòÉΓòÉΓòÉ 13.3.4. ListColors ΓòÉΓòÉΓòÉ
  3816.  
  3817. ListColors = Color:  Sets the colors used by the LIST command.  If this 
  3818. directive is not used, LIST will use the current default colors set by the CLS 
  3819. or COLOR command or by the StdColors directive. 
  3820.  
  3821.  
  3822. ΓòÉΓòÉΓòÉ 13.3.5. ListStatBarColors ΓòÉΓòÉΓòÉ
  3823.  
  3824. ListStatBarColors = Color:  Sets the colors used on the LIST status bar.  If 
  3825. this directive is not used, LIST will set the status bar to the reverse of the 
  3826. screen color (the screen color is controlled by ListColors). 
  3827.  
  3828.  
  3829. ΓòÉΓòÉΓòÉ 13.3.6. SelectColors ΓòÉΓòÉΓòÉ
  3830.  
  3831. SelectColors = Color:  Sets the color used by the SELECT command.  If this 
  3832. directive is not used, SELECT will use the current default colors set by the 
  3833. CLS or COLOR command or by the StdColors directive. 
  3834.  
  3835.  
  3836. ΓòÉΓòÉΓòÉ 13.3.7. SelectStatBarColors ΓòÉΓòÉΓòÉ
  3837.  
  3838. SelectStatBarColors = Color:  Sets the color used on the SELECT status bar.  If 
  3839. this directive is not used, SELECT will set the status bar to the reverse of 
  3840. the screen color (the screen color is controlled by SelectColors). 
  3841.  
  3842.  
  3843. ΓòÉΓòÉΓòÉ 13.3.8. StdColors ΓòÉΓòÉΓòÉ
  3844.  
  3845. StdColors = Color:  Sets the standard colors to be used when CLS is used 
  3846. without a color specification, and for LIST and SELECT if ListColors and 
  3847. SelectColors are not used.  Using this directive is similar to placing a COLOR 
  3848. command in AUTOEXEC.BAT.  StdColors takes effect the first time CLS, LIST, or 
  3849. SELECT is used after 4OS2 starts, but will not affect the color of error or 
  3850. other messages displayed during the loading and initialization process. 
  3851.  
  3852.  
  3853. ΓòÉΓòÉΓòÉ 13.4. Key Mapping Directives ΓòÉΓòÉΓòÉ
  3854.  
  3855. These directives allow you to change the keys used for command-line editing and 
  3856. other internal functions.  They are divided into four types, depending on the 
  3857. context in which the keys are used.  For a discussion and list of directives 
  3858. for each type see: 
  3859.  
  3860.             General Input Keys 
  3861.             Command-Line Editing Keys 
  3862.             History and @SELECT Window Keys 
  3863.             LIST Keys 
  3864.  
  3865.  Using a key mapping directive allows you to assign a different or additional 
  3866.  key to perform the function described.  For example, to use function key F3 to 
  3867.  invoke the HELP facility (normally invoked with F1): 
  3868.  
  3869.           Help = F3
  3870.  
  3871.  Any directive can be used multiple times to assign multiple keys to the same 
  3872.  function.  For example: 
  3873.  
  3874.           ListFind = F            ;F does a find in LIST
  3875.           ListFind = F5           ;F5 also does a find in LIST
  3876.  
  3877.  Use some care when you reassign keystrokes.  If you assign a default key to a 
  3878.  different function, it will no longer be available for its original use.  For 
  3879.  example, if you assign F1 to the AddFile directive (a part of filename 
  3880.  completion), the F1 key will no longer invoke the help system, so you will 
  3881.  probably want to assign a different key to Help. 
  3882.  
  3883.  See Keys and Key Names before using the key mapping directives. 
  3884.  
  3885.  Key assignments are processed before looking for keystroke aliases.  For 
  3886.  example, if you assign Shift-F1 to HELP and also assign Shift-F1 to a key 
  3887.  alias, the key alias will be ignored. 
  3888.  
  3889.  Assigning a new keystroke for a function does not deassign the default 
  3890.  keystroke for the same function.  If you want to deassign one of the default 
  3891.  keys, use the NormalKey directive described below or the corresponding 
  3892.  directive for keys in the other key groups (NormalEditKey, NormalHWinKey, or 
  3893.  NormalListKey). 
  3894.  
  3895.  
  3896. ΓòÉΓòÉΓòÉ 13.4.1. General Input Keys ΓòÉΓòÉΓòÉ
  3897.  
  3898. These directives apply to all input.  They are in effect whenever 4OS2 requests 
  3899. input from the keyboard, including during command-line editing and the 
  3900. DESCRIBE, ESET, INPUT, LIST, and SELECT commands.  The general input keys are: 
  3901.  
  3902.         Backspace           Deletes the character to the left of the cursor 
  3903.         BeginLine           Moves the cursor to the start of the line 
  3904.         Del                 Deletes the character at the cursor 
  3905.         DelToBeginning      Deletes from the cursor to the start of the line 
  3906.         DelToEnd            Deletes from the cursor to the end of the line 
  3907.         DelWordLeft         Deletes the word to the left of the cursor 
  3908.         DelWordRight        Deletes the word to the right of the cursor 
  3909.         Down                * Moves the cursor or scrolls the display down 
  3910.         EndLine             Moves the cursor to the end of the line 
  3911.         EraseLine           Deletes the entire line 
  3912.         ExecLine            Executes or accepts a line 
  3913.         Ins                 Toggles insert / overstrike mode 
  3914.         Left                * Moves the cursor or scrolls the display left 
  3915.         NormalKey           * Deassigns a key 
  3916.         Right               * Moves the cursor or scrolls the display right 
  3917.         Up                  * Moves the cursor or scrolls the display up 
  3918.         WordLeft            Moves the cursor left one word 
  3919.         WordRight           Moves the cursor right one word 
  3920.  
  3921.  
  3922. ΓòÉΓòÉΓòÉ 13.4.1.1. Backspace ΓòÉΓòÉΓòÉ
  3923.  
  3924. Backspace = Key (Bksp):  Deletes the character to the left of the cursor. 
  3925.  
  3926.  
  3927. ΓòÉΓòÉΓòÉ 13.4.1.2. BeginLine ΓòÉΓòÉΓòÉ
  3928.  
  3929. BeginLine = Key (Home):  Moves the cursor to the beginning of the line. 
  3930.  
  3931.  
  3932. ΓòÉΓòÉΓòÉ 13.4.1.3. Del ΓòÉΓòÉΓòÉ
  3933.  
  3934. Del = Key (Del):  Deletes the character at the cursor. 
  3935.  
  3936.  
  3937. ΓòÉΓòÉΓòÉ 13.4.1.4. DelToBeginning ΓòÉΓòÉΓòÉ
  3938.  
  3939. DelToBeginning = Key (Ctrl-Home):  Deletes from the cursor to the start of the 
  3940. line. 
  3941.  
  3942.  
  3943. ΓòÉΓòÉΓòÉ 13.4.1.5. DelToEnd ΓòÉΓòÉΓòÉ
  3944.  
  3945. DelToEnd = Key (Ctrl-End):  Deletes from the cursor to the end of the line. 
  3946.  
  3947.  
  3948. ΓòÉΓòÉΓòÉ 13.4.1.6. DelWordLeft ΓòÉΓòÉΓòÉ
  3949.  
  3950. DelWordLeft = Key (Ctrl-L):  Deletes the word to the left of the cursor. 
  3951.  
  3952.  
  3953. ΓòÉΓòÉΓòÉ 13.4.1.7. DelWordRight ΓòÉΓòÉΓòÉ
  3954.  
  3955. DelWordRight = Key (Ctrl-R, Ctrl-Bksp):  Deletes the word to the right of the 
  3956. cursor.  See ClearKeyMap if you need to remove the default mapping of Ctrl-Bksp 
  3957. to this function. 
  3958.  
  3959.  
  3960. ΓòÉΓòÉΓòÉ 13.4.1.8. Down ΓòÉΓòÉΓòÉ
  3961.  
  3962. Down = Key (Down):  Scrolls the display down one line in LIST; moves the cursor 
  3963. down one line in SELECT and in the command-line history, directory history, or 
  3964. %@SELECT window.  (Scrolling down through the command history at the prompt is 
  3965. controlled by NextHistory, not by this directive.) 
  3966.  
  3967.  
  3968. ΓòÉΓòÉΓòÉ 13.4.1.9. EndLine ΓòÉΓòÉΓòÉ
  3969.  
  3970. EndLine = Key (End):  Moves the cursor to the end of the line. 
  3971.  
  3972.  
  3973. ΓòÉΓòÉΓòÉ 13.4.1.10. EraseLine ΓòÉΓòÉΓòÉ
  3974.  
  3975. EraseLine = Key (Esc):  Deletes the entire line. 
  3976.  
  3977.  
  3978. ΓòÉΓòÉΓòÉ 13.4.1.11. ExecLine ΓòÉΓòÉΓòÉ
  3979.  
  3980. ExecLine = Key (Enter):  Executes or accepts a line. 
  3981.  
  3982.  
  3983. ΓòÉΓòÉΓòÉ 13.4.1.12. Ins ΓòÉΓòÉΓòÉ
  3984.  
  3985. Ins = Key (Ins):  Toggles insert / overstrike mode during line editing. 
  3986.  
  3987.  
  3988. ΓòÉΓòÉΓòÉ 13.4.1.13. Left ΓòÉΓòÉΓòÉ
  3989.  
  3990. Left = Key (Left):  Moves the cursor left one character; scrolls the display 
  3991. left 8 columns in LIST; scrolls the display left 4 columns in the command-line, 
  3992. directory history, or %@SELECT window. 
  3993.  
  3994.  
  3995. ΓòÉΓòÉΓòÉ 13.4.1.14. NormalKey ΓòÉΓòÉΓòÉ
  3996.  
  3997. NormalKey = Key:  Deassigns a general input key in order to disable the usual 
  3998. meaning of the key within 4OS2 and/or make it available for keystroke aliases. 
  3999. This will make the keystroke operate as a "normal" key with no special 
  4000. function.  For example: 
  4001.  
  4002.         NormalKey = Ctrl-End
  4003.  
  4004. will disable Ctrl-End, which is the standard "delete to end of line" key. 
  4005. Ctrl-End could then be assigned to a keystroke alias. Another key could be 
  4006. assigned the "delete to end of line" function with the DelToEnd directive. 
  4007.  
  4008.  
  4009. ΓòÉΓòÉΓòÉ 13.4.1.15. Right ΓòÉΓòÉΓòÉ
  4010.  
  4011. Right = Key (Right):  Moves the cursor right one character; scrolls the display 
  4012. right 8 columns in LIST; scrolls the display right 4 columns in the 
  4013. command-line history, directory history, or %@SELECT window. 
  4014.  
  4015.  
  4016. ΓòÉΓòÉΓòÉ 13.4.1.16. Up ΓòÉΓòÉΓòÉ
  4017.  
  4018. Up = Key (Up):  Scrolls the display up one line in LIST; moves the cursor up 
  4019. one line in SELECT and in the command-line history, directory history, or 
  4020. %@SELECT window.  (Scrolling up through the command history at the prompt is 
  4021. controlled by PrevHistory, not by this directive.) 
  4022.  
  4023.  
  4024. ΓòÉΓòÉΓòÉ 13.4.1.17. WordLeft ΓòÉΓòÉΓòÉ
  4025.  
  4026. WordLeft = Key (Ctrl-Left):  Moves the cursor left one word; scrolls the 
  4027. display left 40 columns in LIST. 
  4028.  
  4029.  
  4030. ΓòÉΓòÉΓòÉ 13.4.1.18. WordRight ΓòÉΓòÉΓòÉ
  4031.  
  4032. WordRight = Key (Ctrl-Right):  Moves the cursor right one word; scrolls the 
  4033. display right 40 columns in LIST. 
  4034.  
  4035.  
  4036. ΓòÉΓòÉΓòÉ 13.4.2. Command-Line Editing Keys ΓòÉΓòÉΓòÉ
  4037.  
  4038. These directives apply only to command-line editing.  They are only effective 
  4039. at the 4OS2 prompt.  The command-line editing keys are: 
  4040.  
  4041.         AddFile             Keeps filename completion entry and adds another 
  4042.         CommandEscape       Allows direct entry of a keystroke 
  4043.         DelHistory          Deletes a history list entry 
  4044.         EndHistory          Displays the last entry in the history list 
  4045.         Help                Invokes this help system 
  4046.         NextFile            Gets the next matching filename 
  4047.         NextHistory         Recalls the next command from the history 
  4048.         NormalEditKey       Deassigns a command-line editing key 
  4049.         PopFile             Opens the filename completion window 
  4050.         PrevFile            Gets the previous matching filename 
  4051.         PrevHistory         Recalls the previous command from the history 
  4052.         SaveHistory         Saves the command line without executing it 
  4053.  
  4054.  
  4055. ΓòÉΓòÉΓòÉ 13.4.2.1. AddFile ΓòÉΓòÉΓòÉ
  4056.  
  4057. AddFile = Key (F10):  Keeps the current filename completion entry and inserts 
  4058. the next matching name. 
  4059.  
  4060.  
  4061. ΓòÉΓòÉΓòÉ 13.4.2.2. CommandEscape ΓòÉΓòÉΓòÉ
  4062.  
  4063. CommandEscape = Key (Alt-255):  Allows direct entry of a keystroke that would 
  4064. normally be interpreted as an editor command. 
  4065.  
  4066.  
  4067. ΓòÉΓòÉΓòÉ 13.4.2.3. DelHistory ΓòÉΓòÉΓòÉ
  4068.  
  4069. DelHistory = Key (Ctrl-D):  Deletes the displayed history list entry and 
  4070. displays the previous entry. 
  4071.  
  4072.  
  4073. ΓòÉΓòÉΓòÉ 13.4.2.4. EndHistory ΓòÉΓòÉΓòÉ
  4074.  
  4075. EndHistory = Key (Ctrl-E):  Displays the last entry in the history list. 
  4076.  
  4077.  
  4078. ΓòÉΓòÉΓòÉ 13.4.2.5. Help ΓòÉΓòÉΓòÉ
  4079.  
  4080. Help = Key (F1):  Invokes the HELP facility. 
  4081.  
  4082.  
  4083. ΓòÉΓòÉΓòÉ 13.4.2.6. NextFile ΓòÉΓòÉΓòÉ
  4084.  
  4085. NextFile = Key (F9, Tab):  Gets the next matching filename. See ClearKeyMap if 
  4086. you need to remove the default mapping of Tab to this function. 
  4087.  
  4088.  
  4089. ΓòÉΓòÉΓòÉ 13.4.2.7. NextHistory ΓòÉΓòÉΓòÉ
  4090.  
  4091. NextHistory = Key (Down):  Recalls the next command from the command history. 
  4092.  
  4093.  
  4094. ΓòÉΓòÉΓòÉ 13.4.2.8. NormalEditKey ΓòÉΓòÉΓòÉ
  4095.  
  4096. NormalEditKey = Key:  Deassigns a command-line editing key in order to disable 
  4097. the usual meaning of the key while editing a command line, and/or make it 
  4098. available for keystroke aliases.  For additional details see NormalKey. 
  4099.  
  4100.  
  4101. ΓòÉΓòÉΓòÉ 13.4.2.9. PopFile ΓòÉΓòÉΓòÉ
  4102.  
  4103. PopFile = Key (F7, Ctrl-Tab):  Opens the filename completion window.  You may 
  4104. not be able to use Ctrl-Tab, because not all systems recognize it as a 
  4105. keystroke.  See ClearKeyMap if you need to remove the default mapping of 
  4106. Ctrl-Tab to this function. 
  4107.  
  4108.  
  4109. ΓòÉΓòÉΓòÉ 13.4.2.10. PrevFile ΓòÉΓòÉΓòÉ
  4110.  
  4111. PrevFile = Key (F8, Shift-Tab):  Gets the previous matching filename.  See 
  4112. ClearKeyMap if you need to remove the default mapping of Shift-Tab to this 
  4113. function. 
  4114.  
  4115.  
  4116. ΓòÉΓòÉΓòÉ 13.4.2.11. PrevHistory ΓòÉΓòÉΓòÉ
  4117.  
  4118. PrevHistory = Key (Up):  Recalls the previous command from the command history. 
  4119.  
  4120.  
  4121. ΓòÉΓòÉΓòÉ 13.4.2.12. SaveHistory ΓòÉΓòÉΓòÉ
  4122.  
  4123. SaveHistory = Key (Ctrl-K):  Saves the command line in the command history list 
  4124. without executing it. 
  4125.  
  4126.  
  4127. ΓòÉΓòÉΓòÉ 13.4.3. History and @SELECT Window Keys ΓòÉΓòÉΓòÉ
  4128.  
  4129. These directives apply only to the command history window, the directory 
  4130. history window, and %@SELECT windows.  The History and @SELECT window keys are: 
  4131.  
  4132.         DirWinOpen          Opens the directory history window 
  4133.         HistWinBegin        Moves to the first line of the history window 
  4134.         HistWinDel          Deletes a line from within the history window 
  4135.         HistWinEdit         Moves a line from the history window to the prompt 
  4136.         HistWinEnd          Moves to the last line of the history window 
  4137.         HistWinExec         Executes the selected line in the history window 
  4138.         HistWinOpen         Opens the command history window 
  4139.         NormalHWinKey       Deassigns a history window key 
  4140.  
  4141.  
  4142. ΓòÉΓòÉΓòÉ 13.4.3.1. DirWinOpen ΓòÉΓòÉΓòÉ
  4143.  
  4144. DirWinOpen = Key (Ctrl-PgUp):  Opens the directory history window while at the 
  4145. command line. 
  4146.  
  4147.  
  4148. ΓòÉΓòÉΓòÉ 13.4.3.2. HistWinBegin ΓòÉΓòÉΓòÉ
  4149.  
  4150. HistWinBegin = Key (Ctrl-PgUp):  Moves to the first line of the history when in 
  4151. the history window. 
  4152.  
  4153.  
  4154. ΓòÉΓòÉΓòÉ 13.4.3.3. HistWinDel ΓòÉΓòÉΓòÉ
  4155.  
  4156. HistWinDel = Key (Ctrl-D):  Deletes a line from within the history window. 
  4157.  
  4158.  
  4159. ΓòÉΓòÉΓòÉ 13.4.3.4. HistWinEdit ΓòÉΓòÉΓòÉ
  4160.  
  4161. HistWinEdit = Key (Ctrl-Enter):  Moves a line from the history window to the 
  4162. prompt for editing. 
  4163.  
  4164.  
  4165. ΓòÉΓòÉΓòÉ 13.4.3.5. HistWinEnd ΓòÉΓòÉΓòÉ
  4166.  
  4167. HistWinEnd = Key (Ctrl-PgDn):  Moves to the last line of the history when in 
  4168. the history window. 
  4169.  
  4170.  
  4171. ΓòÉΓòÉΓòÉ 13.4.3.6. HistWinExec ΓòÉΓòÉΓòÉ
  4172.  
  4173. HistWinExec = Key (Enter):  Executes the selected line in the history window. 
  4174.  
  4175.  
  4176. ΓòÉΓòÉΓòÉ 13.4.3.7. HistWinOpen ΓòÉΓòÉΓòÉ
  4177.  
  4178. HistWinOpen = Key (PgUp):  Brings up the history window while at the command 
  4179. line. 
  4180.  
  4181.  
  4182. ΓòÉΓòÉΓòÉ 13.4.3.8. NormalHWinKey ΓòÉΓòÉΓòÉ
  4183.  
  4184. NormalHWinKey = Key:  Deassigns a history window key in order to disable the 
  4185. usual meaning of the key within the history window. For additional details see 
  4186. NormalKey. 
  4187.  
  4188.  
  4189. ΓòÉΓòÉΓòÉ 13.4.4. LIST Keys ΓòÉΓòÉΓòÉ
  4190.  
  4191. These directives are effective only inside the LIST command.  The LIST keys 
  4192. are: 
  4193.  
  4194.         ListFind            Prompts and searches for a string 
  4195.         ListHex             Toggles hexadecimal display mode 
  4196.         ListHighBit         Toggles LIST's "strip high bit" option 
  4197.         ListInfo            Displays information about the current file 
  4198.         ListNext            Finds the next matching string 
  4199.         ListPrint           Prints the file on LPT1 
  4200.         ListWrap            Toggles LIST's wrap option 
  4201.         NormalListKey       Deassigns a LIST key 
  4202.  
  4203.  
  4204. ΓòÉΓòÉΓòÉ 13.4.4.1. ListFind ΓòÉΓòÉΓòÉ
  4205.  
  4206. ListFind = Key (F):  Prompts and searches for a string. 
  4207.  
  4208.  
  4209. ΓòÉΓòÉΓòÉ 13.4.4.2. ListHex ΓòÉΓòÉΓòÉ
  4210.  
  4211. ListHex = Key (X):  Toggles hexadecimal display mode. 
  4212.  
  4213.  
  4214. ΓòÉΓòÉΓòÉ 13.4.4.3. ListHighBit ΓòÉΓòÉΓòÉ
  4215.  
  4216. ListHighBit = Key (H):  Toggles LIST's "strip high bit" option, which can aid 
  4217. in displaying files from certain word processors. 
  4218.  
  4219.  
  4220. ΓòÉΓòÉΓòÉ 13.4.4.4. ListInfo ΓòÉΓòÉΓòÉ
  4221.  
  4222. ListInfo = Key (I):  Displays information about the current file. 
  4223.  
  4224.  
  4225. ΓòÉΓòÉΓòÉ 13.4.4.5. ListNext ΓòÉΓòÉΓòÉ
  4226.  
  4227. ListNext = Key (N):  Finds the next matching string. 
  4228.  
  4229.  
  4230. ΓòÉΓòÉΓòÉ 13.4.4.6. ListPrint ΓòÉΓòÉΓòÉ
  4231.  
  4232. ListPrint = Key (P):  Prints the file on LPT1. 
  4233.  
  4234.  
  4235. ΓòÉΓòÉΓòÉ 13.4.4.7. ListWrap ΓòÉΓòÉΓòÉ
  4236.  
  4237. ListWrap = Key (W):  Toggles LIST's wrap option on and off. The wrap option 
  4238. wraps text at the right margin. 
  4239.  
  4240.  
  4241. ΓòÉΓòÉΓòÉ 13.4.4.8. NormalListKey ΓòÉΓòÉΓòÉ
  4242.  
  4243. NormalListKey = Key:  Deassigns a LIST key in order to disable the usual 
  4244. meaning of the key within LIST.  For additional details see NormalKey. 
  4245.  
  4246.  
  4247. ΓòÉΓòÉΓòÉ 13.5. Advanced Directives ΓòÉΓòÉΓòÉ
  4248.  
  4249. These directives are generally used for unusual circumstances, or for 
  4250. diagnosing problems.  Most often they are not needed in normal use.  The 
  4251. advanced directives are: 
  4252.  
  4253.         ClearKeyMap         Clear default key mappings 
  4254.         NextINIFile         Set secondary shell .INI file name 
  4255.  
  4256.  
  4257. ΓòÉΓòÉΓòÉ 13.5.1. ClearKeyMap ΓòÉΓòÉΓòÉ
  4258.  
  4259. ClearKeyMap:  Clears all current key mappings. ClearKeyMap is a special 
  4260. directive which has no value or "=" after it.  Use ClearKeyMap to make one of 
  4261. the keys in the default map (Tab, Shift-Tab, Ctrl-Tab, or Ctrl-Bksp) available 
  4262. for a keystroke alias, or in the [Secondary] section of the .INI file to clear 
  4263. key mappings inherited from the primary shell.  ClearKeyMap should appear 
  4264. before any key mapping directives.  If you want to clear some but not all of 
  4265. the default mappings, use ClearKeyMap, then recreate the mappings you want to 
  4266. retain (e.g., with "NextFile=Tab", etc.). 
  4267.  
  4268.  
  4269. ΓòÉΓòÉΓòÉ 13.5.2. NextINIFile ΓòÉΓòÉΓòÉ
  4270.  
  4271. NextINIFile = File.  The full path and name of the file must be specified.  All 
  4272. subsequent shells will read the specified .INI file, and ignore any [Secondary] 
  4273. section in the original .INI file. 
  4274.  
  4275.  
  4276. ΓòÉΓòÉΓòÉ 14. 4OS2 Commands ΓòÉΓòÉΓòÉ
  4277.  
  4278. The best way to learn the 4OS2 commands is to experiment with them.  The lists 
  4279. below categorize the available commands by topic and will help you find the 
  4280. ones that you need. 
  4281.  
  4282. System configuration: 
  4283.  
  4284.         CHCP          CLS           COLOR         DATE
  4285.         FREE          HISTORY       KEYS          KEYBD
  4286.         LOG           MEMORY        PROMPT        REBOOT
  4287.         SETDOS        TIME          VER           VERIFY
  4288.         VOL
  4289.  
  4290. File and directory management: 
  4291.  
  4292.         ATTRIB        COPY          DEL           DESCRIBE
  4293.         LIST          MOVE          REN           SELECT
  4294.         TYPE
  4295.  
  4296. Subdirectory management: 
  4297.  
  4298.         CD            CDD           DIR           DIRS
  4299.         MD            POPD          PUSHD         RD
  4300.  
  4301. Input and output: 
  4302.  
  4303.         DRAWBOX       DRAWHLINE     DRAWVLINE     ECHO
  4304.         ECHOS         INKEY         INPUT         SCREEN
  4305.         SCRPUT        TEXT          VSCRPUT
  4306.  
  4307. Commands primarily for use in or with batch files and aliases (some work only 
  4308. in batch files; see the individual commands for details): 
  4309.  
  4310.         ALIAS         BEEP          CALL          CANCEL
  4311.         DELAY         DO            ENDLOCAL      FOR
  4312.         GLOBAL        GOSUB         GOTO          IF
  4313.         IFF           LOADBTM       ON            PAUSE
  4314.         QUIT          REM           RETURN        SETLOCAL
  4315.         SHIFT         UNALIAS
  4316.  
  4317. Environment and path commands: 
  4318.  
  4319.         DPATH         ESET          PATH          SET
  4320.         UNSET
  4321.  
  4322. Other commands: 
  4323.  
  4324.         ?             DETACH        EXCEPT        EXIT
  4325.         HELP          START         TEE           TIMER
  4326.         WINDOW        Y
  4327.  
  4328.  
  4329. ΓòÉΓòÉΓòÉ 14.1. ? - List the internal commands ΓòÉΓòÉΓòÉ
  4330.  
  4331.  Purpose:    Display a list of internal commands. 
  4332.  
  4333.  Format:     ? 
  4334.  
  4335.  Usage 
  4336.  
  4337.  ? displays a list of internal commands. 
  4338.  
  4339.  If you have disabled a command with SETDOS /I, it will not appear in the list. 
  4340.  
  4341.  
  4342. ΓòÉΓòÉΓòÉ 14.2. ALIAS - Create or display aliases ΓòÉΓòÉΓòÉ
  4343.  
  4344.  Purpose:    Create new command names that execute one or more commands or 
  4345.              redefine default options for existing commands; assign commands to 
  4346.              keystrokes; load or display the list of defined alias names. 
  4347.  
  4348.  Format:     ALIAS [/P /R file...] [name [=][value ]] 
  4349.  
  4350.              file :  One or more files to read for alias definitions. 
  4351.              name :  Name for an alias, or for the key to execute the alias. 
  4352.              value :  Text to be substituted for the alias name. 
  4353.  
  4354.              /P(ause)                        /R(ead file) 
  4355.  
  4356.  See also:  UNALIAS. 
  4357.  
  4358.  Usage 
  4359.  
  4360.  The ALIAS command lets you create new command names or redefine internal 
  4361.  commands.  It also lets you assign one or more commands to a single keystroke. 
  4362.  An alias is often used to execute a complex series of commands with a few 
  4363.  keystrokes or to create "in memory batch files" that run much faster than 
  4364.  disk-based batch files. 
  4365.  
  4366.  For example, if you would rather type D instead of DIR /W, you would use the 
  4367.  command: 
  4368.  
  4369.           [c:\] alias d = dir /w
  4370.  
  4371.  Now when you type a single d as a command, it will be translated into a DIR /W 
  4372.  command. 
  4373.  
  4374.  If you define aliases for commonly used application programs, you can often 
  4375.  remove the directories they're stored in from the PATH. For example, if you 
  4376.  use Quattro Pro and had the C:\QPRO directory in your path, you could define 
  4377.  the following alias: 
  4378.  
  4379.           [c:\] alias qpro = c:\qpro\q.exe
  4380.  
  4381.  With this alias defined, you can probably remove C:\QPRO from your path. 
  4382.  Quattro Pro will now load much faster than it would if 4OS2 had to search the 
  4383.  PATH for it.  In addition, the PATH can be shorter, which will speed up 
  4384.  searches for other programs. 
  4385.  
  4386.  If you apply this technique for each application program, you can often reduce 
  4387.  your PATH to just two or three directories containing utility programs, and 
  4388.  significantly reduce the time it takes to load most software on your system. 
  4389.  Before removing a directory from the PATH, you will need to define aliases for 
  4390.  all the executable programs you commonly use which are stored in that 
  4391.  directory. 
  4392.  
  4393.  Aliases are stored in memory, and are not saved automatically when you turn 
  4394.  off your computer or end your current session.  See below for information on 
  4395.  saving and reloading your aliases. 
  4396.  
  4397.  Multiple Commands and Special Characters in Aliases 
  4398.  
  4399.  An alias can represent more than one command.  For example: 
  4400.  
  4401.           [c:\] alias letters = `cd \letters & text`
  4402.  
  4403.  creates a new command called LETTERS.  The command first uses CD to change to 
  4404.  a subdirectory called \LETTERS and then runs a program called TEXT.  The 
  4405.  ampersand [&] is the command separator and indicates that the two commands are 
  4406.  distinct and should be executed sequentially. 
  4407.  
  4408.  Aliases make extensive use of the command separator, and the parameter 
  4409.  character, and may also use the escape character.  These characters differ 
  4410.  between 4DOS and 4OS2 or 4DOS/NT.  In the text and examples below, we use the 
  4411.  4OS2 characters.  If you want to use the same aliases under different command 
  4412.  processors, see 4DOS, 4OS2, and 4DOS/NT Compatibility. 
  4413.  
  4414.  When you type alias commands at the command line or in a batch file, you must 
  4415.  use back quotes [`] around the definition if it contains multiple commands, 
  4416.  parameters (discussed below), environment variables, redirection, or piping. 
  4417.  The back quotes prevent premature expansion of these arguments.  You may use 
  4418.  back quotes around other definitions, but they are not required. (You do not 
  4419.  need back quotes when your aliases are loaded from an ALIAS /R file; see below 
  4420.  for details.)  The examples above and below include back quotes only when they 
  4421.  are required. 
  4422.  
  4423.  Nested Aliases 
  4424.  
  4425.  Aliases may invoke internal commands, external commands, or other aliases. 
  4426.  (However, an alias may not invoke itself, except in special cases where an IF 
  4427.  or IFF command is used to prevent an infinite loop.)  The two aliases below 
  4428.  demonstrate alias nesting (one alias invoking another).  The first line 
  4429.  defines an alias which runs a program called WP.EXE that is in the E:\WP60\ 
  4430.  subdirectory.  The second alias changes directories with the PUSHD command, 
  4431.  runs the WP alias, and then returns to the original directory with the POPD 
  4432.  command: 
  4433.  
  4434.           [c:\] alias wp = e:\wp60\wp.exe
  4435.           [c:\] alias w = `pushd c:\wp & wp & popd`
  4436.  
  4437.  The second alias above could have included the full path and name of the 
  4438.  WP.EXE program instead of calling the WP alias. However, writing two aliases 
  4439.  makes the second one easier to read and understand, and makes the first alias 
  4440.  available for independent use.  If you rename the WP.EXE program or move it to 
  4441.  a new directory, only the first alias needs to be changed. 
  4442.  
  4443.  Temporarily Disabling Aliases 
  4444.  
  4445.  If you put an asterisk [*] immediately before a command in the value of an 
  4446.  alias definition (the part after the equal sign), it tells 4OS2 not to attempt 
  4447.  to interpret that command as another (nested) alias.  An asterisk used this 
  4448.  way must be preceded by a space or the command separator and followed 
  4449.  immediately by an internal or external command name. 
  4450.  
  4451.  By using an asterisk, you can redefine the default options for any internal 
  4452.  command.  For example, suppose that you always want to use the DIR command 
  4453.  with the /2 (two column) and /P (pause at the end of each page) options: 
  4454.  
  4455.           [c:\] alias dir = *dir /2/p
  4456.  
  4457.  If you didn't include the asterisk, the second DIR on the line would be the 
  4458.  name of the alias itself, and 4OS2 would repeatedly re- invoke the DIR alias, 
  4459.  rather than running the DIR command.  This would cause an "Alias loop" or 
  4460.  "Command line too long" error. 
  4461.  
  4462.  An asterisk also helps you keep the names of internal commands from 
  4463.  conflicting with the names of external programs.  For example, suppose you 
  4464.  have a program called LIST.COM.  Normally, the internal LIST command will run 
  4465.  anytime you type LIST.  But two simple aliases will give you access to both 
  4466.  the LIST.COM program and the LIST command: 
  4467.  
  4468.           [c:\] alias list = c:\util\list.com
  4469.           [c:\] alias display = *list
  4470.  
  4471.  The first line above defines LIST as an alias for the LIST.COM program.  If 
  4472.  you stopped there, the external program would run every time you typed LIST 
  4473.  and you would not have easy access to the internal LIST command.  The second 
  4474.  line renames the internal LIST command as DISPLAY.  The asterisk is needed in 
  4475.  the second command to indicate that the following word means the internal 
  4476.  command LIST, not the LIST alias which runs your external program. 
  4477.  
  4478.  You can also use an asterisk before a command that you enter at the command 
  4479.  line or in a batch file.  If you do, that command won't be interpreted as an 
  4480.  alias.  This can be useful when you want to be sure you are running the true, 
  4481.  original command and not an alias with the same name, or temporarily defeat 
  4482.  the purpose of an alias which changes the meaning or behavior of a command. 
  4483.  
  4484.  Partial Alias Names 
  4485.  
  4486.  You can also use an asterisk in the name of an alias.  When you do, the 
  4487.  characters following the asterisk are optional when you invoke the alias 
  4488.  command.  (Use of an asterisk in the alias name is unrelated to the use of an 
  4489.  asterisk in the alias value discussed above.)  For example, with this alias: 
  4490.  
  4491.           [c:\] alias wher*eis = dir /sp
  4492.  
  4493.  the new command, WHEREIS, can be invoked as WHER, WHERE, WHEREI, or WHEREIS. 
  4494.  Now if you type: 
  4495.  
  4496.           [c:\] where myfile.txt
  4497.  
  4498.  The WHEREIS alias will be expanded to the command: 
  4499.  
  4500.           dir /sp myfile.txt
  4501.  
  4502.  Keystroke Aliases 
  4503.  
  4504.  If you want to assign an alias to a keystroke, use the keyname on the left 
  4505.  side of the equal sign, preceded by an at sign [@]. For example, to assign the 
  4506.  command DIR /W to the F5 key, type 
  4507.  
  4508.           [c:\] alias @F5 = dir /w
  4509.  
  4510.  See Keys and Key Names for a complete listing of key names and a description 
  4511.  of the key name format. 
  4512.  
  4513.  When you define keystroke aliases, the assignments will only be in effect at 
  4514.  the command line, not inside application programs.  Be careful not to assign 
  4515.  aliases to keys that are already used at the command line (like F1 for Help). 
  4516.  The command-line meanings take precedence and the keystroke alias will never 
  4517.  be invoked.  If you want to use one of the command-line keys for an alias 
  4518.  instead of its normal meaning, you must first disable its regular use with the 
  4519.  NormalKey or NormalEditKey directive in your .INI file. 
  4520.  
  4521.  If you define a keystroke alias with a single at sign as shown above, then, 
  4522.  when you press the F5 key, the value of the alias (DIR /W above) will be 
  4523.  placed on the command line for you.  You can type additional parameters if you 
  4524.  wish and then press Enter to execute the command.  With this particular alias, 
  4525.  you can define the files that you want to display after pressing F5 and before 
  4526.  pressing Enter to execute the command. 
  4527.  
  4528.  If you want the keystroke alias to take action automatically without waiting 
  4529.  for you to edit the command line or press Enter, you can begin the definition 
  4530.  with two at signs [@@]. 4OS2 will execute the alias "silently," without 
  4531.  displaying its text on the command line.  For example, this command will 
  4532.  assign an alias to the F6 key that uses the CDD command to take you back to 
  4533.  the previous default directory: 
  4534.  
  4535.           [c:\] alias @@f6 = cdd -
  4536.  
  4537.  You can also define a keystroke alias by using "@" or "@@" plus a scan code 
  4538.  for one of the permissible keys (see the Reference Tables for a list of scan 
  4539.  codes).  In most cases it will be easier to use key names.  Scan codes should 
  4540.  only be used with unusual keyboards where a key name is not available for the 
  4541.  key you are using. 
  4542.  
  4543.  Displaying Aliases 
  4544.  
  4545.  If you want to see a list of all current ALIAS commands, type: 
  4546.  
  4547.           [c:\] alias
  4548.  
  4549.  You can also view the definition of a single alias.  If you want to see the 
  4550.  definition of the alias LIST, you can type: 
  4551.  
  4552.           [c:\] alias list
  4553.  
  4554.  Saving and Reloading Your Aliases 
  4555.  
  4556.  You can save your aliases to a file called ALIAS.LST this way: 
  4557.  
  4558.           [c:\] alias > alias.lst
  4559.  
  4560.  You can then reload all the alias definitions in the file the next time you 
  4561.  boot up with the command: 
  4562.  
  4563.           [c:\] alias /r alias.lst
  4564.  
  4565.  This is much faster than defining each alias individually in a batch file.  If 
  4566.  you keep your alias definitions in a separate file which you load when your 
  4567.  system starts, you can edit them with a text editor, reload the edited file 
  4568.  with ALIAS /R, and know that the same alias list will be loaded the next time 
  4569.  you boot your computer. 
  4570.  
  4571.  When you define aliases in a file that will be read with the ALIAS /R command, 
  4572.  you do not need back quotes around the value, even if back quotes would 
  4573.  normally be required when defining the same alias at the command line or in a 
  4574.  batch file. 
  4575.  
  4576.  To remove an alias, use the UNALIAS command. 
  4577.  
  4578.  Alias Parameters 
  4579.  
  4580.  Aliases can use command-line arguments or parameters like those in batch 
  4581.  files.  The command-line arguments are numbered from %0 to %127.  %0 contains 
  4582.  the alias name.  It is up to the alias to determine the meaning of the other 
  4583.  parameters.  You can use quotation marks to pass spaces, tabs, commas, and 
  4584.  other special characters in an alias parameter; see Argument Quoting for 
  4585.  details. 
  4586.  
  4587.  Parameters that are referred to in an alias, but which are missing on the 
  4588.  command line, appear as empty strings inside the alias.  For example, if you 
  4589.  put two parameters on the command line, any reference in the alias to %3 or 
  4590.  any higher-numbered parameter will be interpreted as an empty string. 
  4591.  
  4592.  The parameter %n$ has a special meaning.  4OS2 interprets it to mean "the 
  4593.  entire command line, from argument n to the end."  If n is not specified, it 
  4594.  has a default value of 1, so %$ means "the entire command line after the alias 
  4595.  name."  The special parameter %# contains the number of command-line 
  4596.  arguments. 
  4597.  
  4598.  For example, the following alias will change directories, perform a command, 
  4599.  and return to the original directory: 
  4600.  
  4601.           [c:\] alias in `pushd %1 & %2$ & popd`
  4602.  
  4603.  When this alias is invoked as: 
  4604.  
  4605.           [c:\] in c:\comm mycomm /xmodem /2400
  4606.  
  4607.  the first parameter, %1, has the value c:\comm.  %2 is mycomm,  %3 is /xmodem, 
  4608.  and %4 is /2400. The command line expands into these three separate commands: 
  4609.  
  4610.           pushd c:\comm
  4611.           mycomm /xmodem /2400
  4612.           popd
  4613.  
  4614.  This next example uses the IFF command to redefine the defaults for SET.  It 
  4615.  should be entered on one line: 
  4616.  
  4617.           [c:\] alias set = `iff %# == 0 then & *set /p
  4618.                & else & *set %& & endiff`
  4619.  
  4620.  This modifies the SET command so that if SET is entered with no arguments, it 
  4621.  is replaced by SET /P (pause after displaying each page), but if SET is 
  4622.  followed by an argument, it behaves normally. Note the use of asterisks (*set) 
  4623.  to prevent alias loops. 
  4624.  
  4625.  If an alias uses parameters, command-line arguments will be deleted up to and 
  4626.  including the highest referenced argument.  For example, if an alias refers 
  4627.  only to %1 and %4, then the first and fourth arguments will be used, the 
  4628.  second and third arguments will be discarded, and any additional arguments 
  4629.  beyond the fourth will be appended to the expanded command (after the value 
  4630.  portion of the alias).  If an alias uses no parameters, all of the command- 
  4631.  line arguments will be appended to the expanded command. 
  4632.  
  4633.  Aliases also have full access to all variables in the environment, internal 
  4634.  variables, and variable functions.  For example, you can create a simple 
  4635.  command-line calculator this way (enter this on one line): 
  4636.  
  4637.           [c:\] alias calc = `echo The answer is: %@eval[%&]`
  4638.  
  4639.  Now, if you enter: 
  4640.  
  4641.           [c:\] calc 5 * 6
  4642.  
  4643.  the alias will display: 
  4644.  
  4645.           The answer is: 30
  4646.  
  4647.  Local and Global Aliases 
  4648.  
  4649.  The aliases can be stored in either a "local" or "global" list. 
  4650.  
  4651.  With a local alias list, any changes made to the aliases will only affect the 
  4652.  current copy of 4OS2.  They will not be visible in other shells or other 
  4653.  sessions. 
  4654.  
  4655.  With a global alias list, all copies of 4OS2 will share the same alias list, 
  4656.  and any changes made to the aliases in one copy will affect all other copies. 
  4657.  This is the default. 
  4658.  
  4659.  You can control the type of alias list with the LocalAliases directive in the 
  4660.  .INI file, and with the /L and /LA options of the START command. 
  4661.  
  4662.  Whenever you start a secondary shell which uses a local alias list, it 
  4663.  inherits a copy of the aliases from the previous shell. However, any changes 
  4664.  to the alias made in the secondary shell will affect only that shell.  If you 
  4665.  want changes made in a secondary shell to affect the previous shell, use a 
  4666.  global alias list in both shells. 
  4667.  
  4668.  Retaining Global Aliases with SHRALIAS 
  4669.  
  4670.  If you select a global alias list for 4OS2 you can share the aliases among all 
  4671.  copies of 4OS2 running in any session.  When you close all 4OS2 sessions, the 
  4672.  memory for the global alias list is released, and a new, empty alias list is 
  4673.  created the next time you start 4OS2. 
  4674.  
  4675.  If you want the alias list to be retained in memory even when no command 
  4676.  processor session is running, you need to load the SHRALIAS program, which 
  4677.  performs this service for both the global alias list and the global history 
  4678.  list.  SHRALIAS is supplied with your copy of 4OS2. 
  4679.  
  4680.  To load SHRALIAS, simply run the SHRALIAS.EXE program, which is normally 
  4681.  installed in the same directory as 4OS2.  You may find it convenient to load 
  4682.  SHRALIAS from your 4START file or your STARTUP.CMD file. 
  4683.  
  4684.  SHRALIAS runs as a "detached" process, which means it does not have a screen 
  4685.  display or accept keyboard input.  It is shut down automatically when OS/2 
  4686.  shuts down.  To unload SHRALIAS manually, run SHRALIAS.EXE with the parameter 
  4687.  /U. 
  4688.  
  4689.  The UNKNOWN_CMD Alias 
  4690.  
  4691.  If you create an alias with the name UNKNOWN_CMD, it will be executed any time 
  4692.  4OS2 would normally issue an "Unknown command" error message.  This allows you 
  4693.  to define your own handler for unknown commands.  When the UNKNOWN_CMD alias 
  4694.  is executed, the command line which generated the error is passed to the alias 
  4695.  for possible processing. 
  4696.  
  4697.  Use caution when you create the UNKNOWN_CMD alias.  If it contains an unknown 
  4698.  command, it will be called repeatedly and 4OS2 will lock up in an infinite 
  4699.  loop. 
  4700.  
  4701.  Options 
  4702.  
  4703.     /P:     (Pause) This option is only effective when ALIAS is used to display 
  4704.             existing definitions.  It pauses the display after each page and 
  4705.             waits for a keystroke before continuing (see Page and File 
  4706.             Prompts). 
  4707.  
  4708.     /R:     (Read file) This option loads an alias list from a file. The format 
  4709.             of the file is the same as that of the ALIAS display: 
  4710.  
  4711.                                 name=value
  4712.  
  4713.             where name is the name of the alias and value is its value.  You 
  4714.             can use an equal sign [=] or space to separate the name and value. 
  4715.             Back quotes are not required around the value.  You can add 
  4716.             comments to the file by starting each comment line with a colon 
  4717.             [:].  You can load multiple files with one ALIAS /R command by 
  4718.             placing the names on the command line, separated by spaces: 
  4719.  
  4720.                                 [c:\] alias /r alias1.lst alias2.lst
  4721.  
  4722.             Each definition in an ALIAS /R file can be up to 2047 characters 
  4723.             long. The definitions can span multiple lines in the file if each 
  4724.             line, except the last, is terminated with an escape character. 
  4725.  
  4726.  
  4727. ΓòÉΓòÉΓòÉ 14.3. ATTRIB - Change or view file attributes ΓòÉΓòÉΓòÉ
  4728.  
  4729.  Purpose:    Change or view file and subdirectory attributes. 
  4730.  
  4731.  Format:     ATTRIB [/D /P /Q /S] [+|-[AHRS]] files ... 
  4732.  
  4733.              files :  A file, directory, or list of files or directories on 
  4734.              which to operate. 
  4735.  
  4736.              /D(irectories)                  /Q(uiet) 
  4737.              /P(ause)                        /S(ubdirectories) 
  4738.  
  4739.              Attribute flags: 
  4740.  
  4741.              +A      Set the archive attribute 
  4742.              -A      Clear the archive attribute 
  4743.              +H      Set the hidden attribute 
  4744.              -H      Clear the hidden attribute 
  4745.              +R      Set the read-only attribute 
  4746.              -R      Clear the read-only attribute 
  4747.              +S      Set the system attribute 
  4748.              -S      Clear the system attribute 
  4749.  
  4750.  File Selection 
  4751.  
  4752.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  4753.  
  4754.  Usage 
  4755.  
  4756.  Every file and subdirectory has 4 attributes that can be turned on (set) or 
  4757.  turned off (cleared):  Archive, Hidden, Read- only, and System. 
  4758.  
  4759.  The ATTRIB command lets you set or clear attributes for any file, group of 
  4760.  files, or subdirectory.  You can view file attributes by entering ATTRIB 
  4761.  without specifying new attributes (i.e., without the [+|-[AHRS]] part of the 
  4762.  format), or with the DIR /T command. 
  4763.  
  4764.  For example, you can set the read-only and hidden attributes for the file MEMO 
  4765.  : 
  4766.  
  4767.           [c:\] attrib +rh memo
  4768.  
  4769.  Attribute options apply to the file(s) that follow the options on the ATTRIB 
  4770.  command line.  The example below shows how to set different attributes on 
  4771.  different files with a single command.  It sets the archive attribute for all 
  4772.  .TXT files, then sets the system attribute and clears the archive attribute 
  4773.  for TEST.COM : 
  4774.  
  4775.           [c:\] attrib +a *.txt +s -a test.com
  4776.  
  4777.  Your operating system also supports "D" (subdirectory) and "V" (volume label) 
  4778.  attributes.  These attributes cannot be altered with ATTRIB; they are designed 
  4779.  to be controlled only by the operating system itself. 
  4780.  
  4781.  Options 
  4782.  
  4783.     /D:     (Directories) If you use the /D option, ATTRIB will modify the 
  4784.             attributes of subdirectories in addition to files (yes, you can 
  4785.             have a hidden subdirectory): 
  4786.  
  4787.                                 [c:\] attrib /d +h c:\mydir
  4788.  
  4789.             In addition, the /D option will keep ATTRIB from appending "\*.*" 
  4790.             to the end of a directory name and modifying the attributes of all 
  4791.             the files in the subdirectory. 
  4792.  
  4793.             If you use a directory name instead of a file name, and omit /D, 
  4794.             ATTRIB will append "\*.*" to the end of the name and act on all 
  4795.             files in that directory, rather than acting on the directory 
  4796.             itself. 
  4797.  
  4798.     /P:     (Pause) Wait for a key to be pressed after each screen page before 
  4799.             continuing the display.  Your options at the prompt are explained 
  4800.             in detail under Page and File Prompts. 
  4801.  
  4802.     /Q:     (Quiet) This option turns off ATTRIB's normal screen output. It is 
  4803.             most useful in batch files. 
  4804.  
  4805.     /S:     (Subdirectories) If you use the /S option, the ATTRIB command will 
  4806.             be applied to all matching files in the current or named directory 
  4807.             and all of its subdirectories. 
  4808.  
  4809.  
  4810. ΓòÉΓòÉΓòÉ 14.4. BEEP - Beep the speaker ΓòÉΓòÉΓòÉ
  4811.  
  4812.  Purpose:    Beep the speaker or play simple music. 
  4813.  
  4814.  Format:     BEEP [frequency duration ...] 
  4815.  
  4816.              frequency :  The beep frequency in Hertz (cycles per second). 
  4817.              duration :  The beep length in 1/18th second intervals. 
  4818.  
  4819.  Usage 
  4820.  
  4821.  BEEP generates a sound through your computer's speaker.  It is normally used 
  4822.  in batch files to signal that an operation has been completed, or that the 
  4823.  computer needs attention. 
  4824.  
  4825.  Because BEEP allows you to specify the frequency and duration of the sound, 
  4826.  you can also use it to play simple music or to create different kinds of 
  4827.  signals for the user. 
  4828.  
  4829.  You can include as many frequency and duration pairs as you wish. No sound 
  4830.  will be generated for frequencies less than 20 Hz, allowing you to insert 
  4831.  short delays.  The default value for frequency is 440 Hz; the default value 
  4832.  for duration is 2. 
  4833.  
  4834.  This batch file fragment runs a program called DEMO, then plays a few notes 
  4835.  and waits for you to press a key: 
  4836.  
  4837.           demo & beep 440 4  600 2  1040 6
  4838.           pause Finished with the demo - hit a key...
  4839.  
  4840.  The following table gives the frequency values for a five octave range (middle 
  4841.  C is 262 Hz): 
  4842.  
  4843.           ΓòöΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòñΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòñΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòñΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòñΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòñΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòù
  4844.           Γòæ C      Γöé  131  Γöé  262  Γöé  523  Γöé  1046  Γöé  2093 Γòæ
  4845.           Γòæ C#/Db  Γöé  139  Γöé  277  Γöé  554  Γöé  1108  Γöé  2217 Γòæ
  4846.           Γòæ D      Γöé  147  Γöé  294  Γöé  587  Γöé  1175  Γöé  2349 Γòæ
  4847.           Γòæ D#/Eb  Γöé  156  Γöé  311  Γöé  622  Γöé  1244  Γöé  2489 Γòæ
  4848.           Γòæ E      Γöé  165  Γöé  330  Γöé  659  Γöé  1318  Γöé  2637 Γòæ
  4849.           Γòæ F      Γöé  175  Γöé  349  Γöé  698  Γöé  1397  Γöé  2794 Γòæ
  4850.           Γòæ F#/Gb  Γöé  185  Γöé  370  Γöé  740  Γöé  1480  Γöé  2960 Γòæ
  4851.           Γòæ G      Γöé  196  Γöé  392  Γöé  784  Γöé  1568  Γöé  3136 Γòæ
  4852.           Γòæ G#/Ab  Γöé  208  Γöé  415  Γöé  831  Γöé  1662  Γöé  3322 Γòæ
  4853.           Γòæ A      Γöé  220  Γöé  440  Γöé  880  Γöé  1760  Γöé  3520 Γòæ
  4854.           Γòæ A#/Bb  Γöé  233  Γöé  466  Γöé  932  Γöé  1866  Γöé  3729 Γòæ
  4855.           Γòæ B      Γöé  248  Γöé  494  Γöé  988  Γöé  1973  Γöé  3951 Γòæ
  4856.           ΓòÜΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòºΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòºΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòºΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòºΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòºΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓòÉΓò¥
  4857.  
  4858.  
  4859. ΓòÉΓòÉΓòÉ 14.5. CALL - Execute one batch file from another ΓòÉΓòÉΓòÉ
  4860.  
  4861.  Purpose:    Execute one batch file from within another. 
  4862.  
  4863.  Format:     CALL file 
  4864.  
  4865.              file :  The batch file to execute. 
  4866.  
  4867.  See also:  CANCEL and QUIT. 
  4868.  
  4869.  Usage 
  4870.  
  4871.  CALL allows batch files to call other batch files (batch file nesting).  The 
  4872.  calling batch file is suspended while the called (second) batch file runs. 
  4873.  When the second batch file finishes, the original batch file resumes execution 
  4874.  at the next command.  If you execute a batch file from inside another batch 
  4875.  file without using CALL, the first batch file is terminated before the second 
  4876.  one starts. 
  4877.  
  4878.  4OS2 supports batch file nesting up to ten levels deep. 
  4879.  
  4880.  The current ECHO state is inherited by a called batch file. 
  4881.  
  4882.  A called batch file will return to the calling file after processing the last 
  4883.  line in the called file, or when a QUIT command is executed.  A called batch 
  4884.  file should always return in this way, or terminate all batch files with 
  4885.  CANCEL.  Restarting (or CALLing) the original batch file from within a called 
  4886.  file will prevent 4OS2 from detecting that you've left the second file, and it 
  4887.  may cause an infinite loop or a stack overflow. 
  4888.  
  4889.  CALL returns an exit code which matches the batch file return code. You can 
  4890.  test this exit code with the %_? or %? environment variable, and use it with 
  4891.  conditional commands(&& and ||). 
  4892.  
  4893.  
  4894. ΓòÉΓòÉΓòÉ 14.6. CANCEL - Terminate batch file processing ΓòÉΓòÉΓòÉ
  4895.  
  4896.  Purpose:    Terminate batch file processing. 
  4897.  
  4898.  Format:     CANCEL [value ] 
  4899.  
  4900.              value :  The exit code from 0 to 255 to return to 4OS2. 
  4901.  
  4902.  See also:  CALL and QUIT. 
  4903.  
  4904.  Usage 
  4905.  
  4906.  The CANCEL command ends all batch file processing, regardless of the batch 
  4907.  file nesting level.  Use QUIT to end a nested batch file and return to the 
  4908.  previous batch file. 
  4909.  
  4910.  You can CANCEL at any point in a batch file.  If CANCEL is used from within an 
  4911.  alias it will end execution of both the alias and any batch file(s) which are 
  4912.  running at the time. 
  4913.  
  4914.  The following batch file fragment compares an input line to "end" and 
  4915.  terminates all batch file processing if it matches: 
  4916.  
  4917.           input Enter your choice:  %%option
  4918.           if "%option" == "end" cancel
  4919.  
  4920.  If you specify a value, CANCEL will set the ERRORLEVEL or exit code to 
  4921.  thatvalue (see the IF command, and the %? variable). 
  4922.  
  4923.  
  4924. ΓòÉΓòÉΓòÉ 14.7. CD - Change the current directory ΓòÉΓòÉΓòÉ
  4925.  
  4926.  Purpose:    Display or change the current directory. 
  4927.  
  4928.  Format:     CD [ path | - ] 
  4929.                 or 
  4930.              CHDIR [ path | - ] 
  4931.  
  4932.              path :  The directory to change to, including an optional drive 
  4933.              name. 
  4934.  
  4935.  See also:  CDD, MD, PUSHD, RD, and CDPATH. 
  4936.  
  4937.  Usage 
  4938.  
  4939.  CD and CHDIR are synonyms.  You can use either one. 
  4940.  
  4941.  CD lets you navigate through the disk subdirectory structure by changing the 
  4942.  current working directory.  If you enter CD and a directory name, the named 
  4943.  directory becomes the new current directory.  For example, to change to the 
  4944.  subdirectory C:\FINANCE\MYFILES : 
  4945.  
  4946.           [c:\] cd \finance\myfiles
  4947.           [c:\finance\myfiles]
  4948.  
  4949.  Every disk drive on the system has its own current directory. Specifying both 
  4950.  a drive and a directory in the CD command will change the current directory on 
  4951.  the specified drive, but will not change the default drive.  For example, to 
  4952.  change the default directory on drive A: 
  4953.  
  4954.           [c:\] cd a:\utility
  4955.           [c:\]
  4956.  
  4957.  Notice that this command does not change to drive A:.  Use the CDD command to 
  4958.  change the current drive and directory at the same time. 
  4959.  
  4960.  You can change to the parent directory with CD ..; you can also go up one 
  4961.  additional directory level with each additional [.]. For example, CD .... will 
  4962.  go up three levels in the directory tree (see Extended Parent Directory 
  4963.  Names).  You can move to a sibling directory -- one that branches from the 
  4964.  same parent directory as the current subdirectory -- with a command like CD 
  4965.  ..\newdir. 
  4966.  
  4967.  If you enter CD with no argument or with only a disk drive name, it will 
  4968.  display the current directory on the default or named drive. 
  4969.  
  4970.  CD saves the current directory before changing to a new directory. You can 
  4971.  switch back to the previous directory by entering CD -. (There must be a space 
  4972.  between the CD command and the hyphen.)  You can switch back and forth between 
  4973.  two directories by repeatedly entering CD -.  The saved directory is the same 
  4974.  for both the CD and CDD commands.  Drive changes and automatic directory 
  4975.  changes also modify the saved directory, so you can use CD - to return to a 
  4976.  directory that you exited with an automatic directory change. 
  4977.  
  4978.  Directory changes made with CD are recorded for display in the directory 
  4979.  history window. 
  4980.  
  4981.  CD never changes the default drive.  If you change directories on one drive, 
  4982.  switch to another drive, and then enter CD -, the directory will be restored 
  4983.  on the first drive but the current drive will not be changed. 
  4984.  
  4985.  If CD can't change directly to the specified directory, it will look for the 
  4986.  CDPATH variable; see CDPATH for details. 
  4987.  
  4988.  
  4989. ΓòÉΓòÉΓòÉ 14.8. CDD - Change the current drive and directory ΓòÉΓòÉΓòÉ
  4990.  
  4991.  Purpose:    Change the current disk drive and directory. 
  4992.  
  4993.  Format:     CDD path 
  4994.  
  4995.              path :  The name of the directory (or drive and directory) to 
  4996.              change to. 
  4997.  
  4998.  See also:  CD, MD, PUSHD, RD, and CDPATH. 
  4999.  
  5000.  Usage 
  5001.  
  5002.  CDD is similar to the CD command, except that it also changes the default disk 
  5003.  drive if one is specified.  CDD will change to the directory and drive you 
  5004.  name.  To change from the root directory on drive A to the subdirectory C:\WP: 
  5005.  
  5006.           [a:\] cdd c:\wp
  5007.           [c:\wp]
  5008.  
  5009.  You can change to the parent directory with CDD ..; you can also go up one 
  5010.  additional directory level with each additional [.].  For example, CDD .... 
  5011.  will go up three levels in the directory tree. 
  5012.  
  5013.  CDD saves the current drive and directory before changing to a new directory. 
  5014.  You can switch back to the previous drive and directory by entering CDD -. 
  5015.  (There must be a space between the CDD command and the hyphen.)  You can 
  5016.  switch back and forth between two drives and directories by repeatedly 
  5017.  entering CDD -.  The saved directory is the same for both the CD and CDD 
  5018.  commands.  Drive changes and automatic directory changes also modify the saved 
  5019.  directory, so you can use CDD - to return to a directory that you exited with 
  5020.  a drive change or an automatic directory change. 
  5021.  
  5022.  Directory changes made with CDD are recorded for display in the directory 
  5023.  history window. 
  5024.  
  5025.  If CDD can't change directly to the specified directory, it will look for the 
  5026.  CDPATH variable; see CDPATH for details. 
  5027.  
  5028.  
  5029. ΓòÉΓòÉΓòÉ 14.9. CHCP - Change the current code page ΓòÉΓòÉΓòÉ
  5030.  
  5031.  Purpose:    Display or change the current system code page. 
  5032.  
  5033.  Format:     CHCP [n ] 
  5034.  
  5035.              n :  A system code page number. 
  5036.  
  5037.  Usage 
  5038.  
  5039.  Code page switching allows you to select different character sets for language 
  5040.  support. 
  5041.  
  5042.  If you enter CHCP without a number, the current code page is displayed. 
  5043.  
  5044.           [c:\] chcp
  5045.           Active code page: 437
  5046.  
  5047.  If you enter CHCP plus a code page number, the system code page is changed. 
  5048.  For example, to set the code page to multilingual: 
  5049.  
  5050.           [c:\] chcp 850
  5051.  
  5052.  CHCP accepts one of the prepared system code pages.  An error message is 
  5053.  displayed if a code page is selected that has not been prepared for the 
  5054.  system. 
  5055.  
  5056.  See your OS/2 documentation for more information on CHCP. 
  5057.  
  5058.  
  5059. ΓòÉΓòÉΓòÉ 14.10. CLS - Clear the screen ΓòÉΓòÉΓòÉ
  5060.  
  5061.  Purpose:    Clear the video display and move the cursor to the upper left 
  5062.              corner; optionally change the default display and border colors. 
  5063.  
  5064.  Format:     CLS [[BRIght] [BLInk] fg ON [BRIght] bg ] [BORder bc ] 
  5065.  
  5066.              fg :  The new foreground color 
  5067.              bg :  The new background color 
  5068.              bc :  The new border color 
  5069.  
  5070.  Usage 
  5071.  
  5072.  CLS can be used to clear the screen without changing colors, or to clear the 
  5073.  screen and change the screen colors simultaneously. These three examples show 
  5074.  how to clear the screen to the default colors, to bright white letters on a 
  5075.  blue background, and to bright yellow letters on a magenta background with a 
  5076.  blue border: 
  5077.  
  5078.           [c:\] cls
  5079.           [c:\] cls bright white on blue
  5080.           [c:\] cls bri yel on mag bor blu
  5081.  
  5082.  CLS is often used in batch files to clear the screen before displaying text. 
  5083.  
  5084.  See Colors and Color Names for details about colors and notes on the use of 
  5085.  bright background colors. 
  5086.  
  5087.  
  5088. ΓòÉΓòÉΓòÉ 14.11. COLOR - Change the display colors ΓòÉΓòÉΓòÉ
  5089.  
  5090.  Purpose:    Change the default display colors. 
  5091.  
  5092.  Format:     COLOR [BRIght] [BLInk] fg ON [BRIght] bg [BORder bc ] 
  5093.  
  5094.              fg :  The new foreground color 
  5095.              bg :  The new background color 
  5096.              bc :  The new border color 
  5097.  
  5098.  See also:  CLS, and Colors and Color Names for details about using colors. 
  5099.  
  5100.  Usage 
  5101.  
  5102.  COLOR is normally used in batch files before displaying text. For example, to 
  5103.  set screen colors to bright white on blue, you can use this command: 
  5104.  
  5105.           [c:\] color bright white on blue
  5106.  
  5107.  
  5108. ΓòÉΓòÉΓòÉ 14.12. COPY - Copy files ΓòÉΓòÉΓòÉ
  5109.  
  5110.  Purpose:    Copy data between disks, directories, files, or physical hardware 
  5111.              devices (such as your printer or serial port). 
  5112.  
  5113.  Format:     COPY [/C /H /M /N /P /Q /R /S /T /U /V] source [+] ... [/A /B] 
  5114.              destination [/A /B] 
  5115.  
  5116.              source :  A file or list of files or a device to copy from. 
  5117.              destination :  A file, directory, or device to copy to. 
  5118.  
  5119.              /A(SCII)                        /Q(uiet) 
  5120.              /B(inary)                       /R(eplace) 
  5121.              /C(hanged)                      /S(ubdirectories) 
  5122.              /H(idden)                       /T(otals) 
  5123.              /M(odified)                     /U(pdate) 
  5124.              /N(othing)                      /V(erify) 
  5125.              /P(rompt) 
  5126.  
  5127.  See also:  ATTRIB, MOVE, and REN. 
  5128.  
  5129.  File Selection 
  5130.  
  5131.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  5132.  Date, time, or size ranges anywhere on the line apply to all source files. 
  5133.  
  5134.  Usage 
  5135.  
  5136.  The COPY command accepts all traditional syntax and options and adds several 
  5137.  new features. 
  5138.  
  5139.  The simplest use of COPY is to make a copy of a file, like this example which 
  5140.  makes a copy of a file called FILE1.ABC : 
  5141.  
  5142.           [c:\] copy file1.abc file2.def
  5143.  
  5144.  You can also copy a file to another drive and/or directory.  The following 
  5145.  command copies FILE1 to the \MYDIR directory on drive E: 
  5146.  
  5147.           [c:\] copy file1 e:\mydir
  5148.  
  5149.  You can copy several files at once by using wildcards: 
  5150.  
  5151.           [c:\] copy *.txt e:\mydir
  5152.  
  5153.  You can also list several source files in one command.  The following command 
  5154.  copies 3 files from the current directory to the \MYDIR directory on drive E: 
  5155.  
  5156.           [c:\] copy file1 file2 file3 e:\mydir
  5157.  
  5158.  The way COPY interprets your command line depends on how many arguments (file, 
  5159.  directory, or device names) are on the line, and whether the arguments are 
  5160.  separated with [+] signs or spaces. 
  5161.  
  5162.  If there is only one argument on the line, COPY assumes it is the source, and 
  5163.  uses the current drive and directory as the destination.  For example, the 
  5164.  following command copies all the .DAT files on drive A to the current 
  5165.  directory on drive C: 
  5166.  
  5167.           [c:\] copy a:*.dat
  5168.  
  5169.  If there are two or more arguments on the line and [+] signs are not used, 
  5170.  then COPY assumes that the last argument is the destination and copies all 
  5171.  source files to this new location.  If the destination is a drive, directory, 
  5172.  or device name then the source files are copied individually to the new 
  5173.  location.  If the destination is a file name, the first source file is copied 
  5174.  to the destination, and any additional source files are then appended to the 
  5175.  new destination file. 
  5176.  
  5177.  For example, the first of these commands copies the .DAT files from the 
  5178.  current directory on drive A individually to C:\MYDIR (which must already 
  5179.  exist as a directory); the second appends all the .DAT files together into one 
  5180.  large file called C:\DATA (assuming C:\DATA is not a directory): 
  5181.  
  5182.           [c:\] copy a:*.dat c:\mydir\
  5183.           [c:\] copy a:*.dat c:\data
  5184.  
  5185.  When you copy to a directory, if you add a backslash [\] to the end of the 
  5186.  name as shown in the first example above, COPY will display an error message 
  5187.  if the name does not refer to an existing directory.  You can use this feature 
  5188.  to keep COPY from treating a mistyped destination directory name as a file 
  5189.  name and attempting to append all your source files to a destination file, 
  5190.  when you really meant to copy them individually to a destination directory. 
  5191.  
  5192.  A plus [+] tells COPY to append two or more files to a single destination 
  5193.  file.  If you list several source files separated with [+] and don't specify a 
  5194.  destination, COPY will use the name of the first source file as the 
  5195.  destination, and append each subsequent file to the first file.  In this case 
  5196.  the destination file will always be created in the current directory, even if 
  5197.  the first source file is in another directory or on another drive. 
  5198.  
  5199.  For example, the following command will append the contents of C:\MEMO2 and 
  5200.  C:\MEMO3 to C:\MEMO1 and leave the combined contents in the file named 
  5201.  C:\MEMO1 : 
  5202.  
  5203.           [c:\] copy memo1+memo2+memo3
  5204.  
  5205.  To append the same three files but store the result in BIGMEMO: 
  5206.  
  5207.           [c:\] copy memo1+memo2+memo3 bigmemo
  5208.  
  5209.  To append C:\MEM\MEMO2 and C:\MEM\MEMO3 to D:\DATA\MEMO1, and leave the result 
  5210.  in C:\MEM\MEMO1 : 
  5211.  
  5212.           [c:\mem] copy d:\data\memo1+memo2+memo3
  5213.  
  5214.  You cannot append files to a device (such as a printer); if you try to do so, 
  5215.  COPY will ignore the [+] signs and copy the files individually.  If you 
  5216.  attempt to append several source files to a destination directory or disk, 
  5217.  COPY will append the files and place the copy in the new location with the 
  5218.  same name as the first source file. 
  5219.  
  5220.  If your destination has wildcards in it, COPY will attempt to match them with 
  5221.  the source names.  For example, this command copies the .DAT files from drive 
  5222.  A to C:\MYDIR and gives the new copies the extension .DX : 
  5223.  
  5224.           [c:\] copy a:*.dat c:\mydir\*.dx
  5225.  
  5226.  This feature can give you unexpected results if you use it with multiple 
  5227.  source file names.  For example, suppose that drive A contains XYZ.DAT and 
  5228.  XYZ.TXT.  The command 
  5229.  
  5230.           [c:\] copy a:\*.dat a:\*.txt c:\mydir\*.dx
  5231.  
  5232.  will copy A:XYZ.DAT to C:\MYDIR\XYZ.DX.  Then it will copy A:XYZ.TXT to 
  5233.  C:\MYDIR\XYZ.DX, overwriting the first file it copied. 
  5234.  
  5235.  COPY also understands include lists, so you can specify several different 
  5236.  kinds of files in the same command.  This command copies the .TXT, .DOC, and 
  5237.  .BAT files from the E:\MYDIR directory to the root directory of drive A: 
  5238.  
  5239.           [c:\] copy e:\mydir\*.txt;*.doc;*.bat a:\
  5240.  
  5241.  You can use date, time, and size ranges to further define the files that you 
  5242.  want to copy.  This example copies every file in the E:\MYDIR directory, which 
  5243.  was created or modified yesterday, and which is also 10,000 bytes or smaller 
  5244.  in size, to the root directory of drive A: 
  5245.  
  5246.           [c:\] copy /[d-1] /[s0,10000] e:\mydir\*.* a:\
  5247.  
  5248.  COPY maintains the hidden and system attributes of files, but not the 
  5249.  read-only attribute.  The destination file will always have the archive 
  5250.  attribute set. 
  5251.  
  5252.  Options 
  5253.  
  5254.  The /A(SCII) and /B(inary) options apply to the preceding filename and to all 
  5255.  subsequent filenames on the command line until the file name preceding the 
  5256.  next /A or /B, if any.  The other options (/C, /H, /M, /N, /P, /Q, /R, /S, /T, 
  5257.  /U, /V) apply to all filenames on the command line, no matter where you put 
  5258.  them.  For example, either of the following commands could be used to copy a 
  5259.  font file to the printer in binary mode: 
  5260.  
  5261.           [c:\] copy /b myfont.dat prn
  5262.           [c:\] copy myfont.dat /b prn
  5263.  
  5264.  Some options do not make sense in certain contexts, in which case COPY will 
  5265.  ignore them.  For example, you cannot prompt before replacing an existing file 
  5266.  when the destination is a device such as the printer -- there's no such thing 
  5267.  as an "existing file" on the printer.  If you use conflicting output options, 
  5268.  like /Q and /P, COPY will take a "conservative" approach and give priority to 
  5269.  the option which generates more prompts or more information. 
  5270.  
  5271.     /A:     (ASCII) If you use /A with a source filename, the file will be 
  5272.             copied up to, but not including, the first Ctrl-Z (Control-Z or 
  5273.             ASCII 26) character in the file.  If you use /A with a destination 
  5274.             filename, a Ctrl-Z will be added to the end of the file (some 
  5275.             application programs use the Ctrl-Z to mark the end of a file).  /A 
  5276.             is the default when appending files, or when the destination is a 
  5277.             device like NUL or PRN, rather than a disk file. 
  5278.  
  5279.     /B:     (Binary) If you use /B with a source filename, the entire file is 
  5280.             copied; Ctrl-Z characters in the file do not affect the copy 
  5281.             operation.  Using /B with a destination filename prevents addition 
  5282.             of a Ctrl-Z to the end of the destination file. /B is the default 
  5283.             for normal file copies. 
  5284.  
  5285.     /C:     (Changed files) Copy files only if the destination file exists and 
  5286.             is older than the source (see also /U).  This option is useful for 
  5287.             updating the files in one directory from those in another without 
  5288.             copying any newly created files. 
  5289.  
  5290.     /H:     (Hidden) Copy all matching files including those with the hidden 
  5291.             and/or system attribute set. 
  5292.  
  5293.     /M:     (Modified) Copy only those files with the archive attribute set, 
  5294.             i.e., those which have been modified since the last backup.  The 
  5295.             archive attribute will not be cleared after copying. 
  5296.  
  5297.     /N:     (Nothing) Do everything except actually perform the copy. This 
  5298.             option is useful for testing what the result of a complex COPY 
  5299.             command will be. 
  5300.  
  5301.     /P:     (Prompt) Ask the user to confirm each source file.  Your options at 
  5302.             the prompt are explained in detail under Page and File Prompts. 
  5303.  
  5304.     /Q:     (Quiet) Don't display filenames or the total number of files 
  5305.             copied.  This option is most often used in batch files.  See also 
  5306.             /T. 
  5307.  
  5308.     /R:     (Replace) Prompt the user before overwriting an existing file. 
  5309.             Your options at the prompt are explained in detail under Page and 
  5310.             File Prompts. 
  5311.  
  5312.     /S:     (Subdirectories) Copy the subdirectory tree starting with the files 
  5313.             in the source directory plus each subdirectory below that.  The 
  5314.             destination must be a directory; if it doesn't exist, COPY will 
  5315.             attempt to create it.  COPY will also attempt to create needed 
  5316.             subdirectories on the tree below the destination, including empty 
  5317.             source directories.  If you attempt to use COPY /S to copy a 
  5318.             subdirectory tree into part of itself, COPY will display an error 
  5319.             message and exit. 
  5320.  
  5321.     /T:     (Totals) Turns off  the display of filenames, like /Q, but does 
  5322.             display the total number of files copied. 
  5323.  
  5324.     /U:     (Update) Copy each source file only if it is newer than a matching 
  5325.             destination file or if a matching destination file does not exist 
  5326.             (see also /C).  This option is useful for keeping one directory 
  5327.             matched with another with a minimum of copying. 
  5328.  
  5329.     /V:     (Verify) Verify each disk write.  This is the same as executing the 
  5330.             VERIFY ON command, but is only active during the COPY.  /V does not 
  5331.             read back the file and compare its contents with what was written; 
  5332.             it only verifies that the data written to disk is physically 
  5333.             readable. 
  5334.  
  5335.  
  5336. ΓòÉΓòÉΓòÉ 14.13. DATE - Change the system date ΓòÉΓòÉΓòÉ
  5337.  
  5338.  Purpose:    Display and optionally change the system date. 
  5339.  
  5340.  Format:     DATE [mm -dd -yy ] 
  5341.  
  5342.              mm :  The month (1 - 12). 
  5343.              dd :  The day (1 - 31). 
  5344.              yy :  The year (80 - 99 = 1980 - 1999, or a 4- digit year). 
  5345.  
  5346.  See also:  TIME. 
  5347.  
  5348.  Usage 
  5349.  
  5350.  If you simply type DATE without any parameters, you will see the current 
  5351.  system date and time, and be prompted for a new date. Press ENTER if you don't 
  5352.  wish to change the date.  If you type a new date, it will become the current 
  5353.  system date, which is included in the directory entry for each file as it is 
  5354.  created or altered: 
  5355.  
  5356.           [c:\] date
  5357.           Wed  Dec 22, 1993  9:30:06
  5358.           Enter new date (mm-dd-yy):
  5359.  
  5360.  You can also enter a new system date by typing the DATE command plus the new 
  5361.  date on the command line: 
  5362.  
  5363.           [c:\] date 3-16-94
  5364.  
  5365.  You can use hyphens, slashes, or periods to separate the month, day, and year 
  5366.  entries.  A full 4-digit year can be entered if you wish. 
  5367.  
  5368.  DATE adjusts the format it expects depending on your country settings.  When 
  5369.  entering the date, use the correct format for the country setting currently in 
  5370.  effect on your system. 
  5371.  
  5372.  
  5373. ΓòÉΓòÉΓòÉ 14.14. DEL - Delete one or more files ΓòÉΓòÉΓòÉ
  5374.  
  5375.  Purpose:    Erase one file, a group of files, or entire subdirectories. 
  5376.  
  5377.  Format:     DEL [/F /N /P /Q /S /T /X /Y /Z] file... 
  5378.                 or 
  5379.              ERASE [/F /N /P /Q /S /T /X /Y /Z] file... 
  5380.  
  5381.              file :  The file, subdirectory, or list of files or subdirectories 
  5382.              to erase. 
  5383.  
  5384.              /F(orce delete)                 /T(otal) 
  5385.              /N(othing)                      /X (remove empty subdirectories) 
  5386.              /P(rompt)                       /Y(es to all prompts) 
  5387.              /Q(uiet)                        /Z(ap hidden and read-only files) 
  5388.              /S(ubdirectories) 
  5389.  
  5390.  File Selection 
  5391.  
  5392.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  5393.  
  5394.  Usage 
  5395.  
  5396.  DEL and ERASE are synonyms, you can use either one. 
  5397.  
  5398.  Use the DEL and ERASE commands with caution; the files and subdirectories that 
  5399.  you erase may be impossible to recover without specialized utilities and a lot 
  5400.  of work. 
  5401.  
  5402.  To erase a single file, simply enter the file name: 
  5403.  
  5404.           [c:\] del letters.txt
  5405.  
  5406.  You can also erase multiple files in a single command.  For example, to erase 
  5407.  all the files in the current directory with a .BAK or .PRN extension: 
  5408.  
  5409.           [c:\] del *.bak *.prn
  5410.  
  5411.  If you enter a subdirectory name, or a filename composed only of wildcards (* 
  5412.  and/or ?), DEL asks for confirmation (Y or N) unless you specified the /Y 
  5413.  option.  If you respond with a Y, DEL will delete all the files in that 
  5414.  subdirectory (hidden, system, and read-only files are only deleted if you use 
  5415.  the /Z option). 
  5416.  
  5417.  DEL displays the amount of disk space recovered, unless the /Q option is used 
  5418.  (see below).  It does so by comparing the amount of free disk space before and 
  5419.  after the DEL command is executed.  This amount may be incorrect if you are 
  5420.  using a deletion tracking system which stores deleted files in a hidden 
  5421.  directory, or if, under a multitasking system, another program performs a file 
  5422.  operation while the DEL command is executing. 
  5423.  
  5424.  Remember that DEL removes file descriptions along with files.  Most deletion 
  5425.  tracking systems will not be able to save or recover a file's description, 
  5426.  even if they can save or recover the data in a file. 
  5427.  
  5428.  DEL returns a non-zero exit code if no files are deleted, or if another error 
  5429.  occurs.  You can test this exit code with the %_? environment variable, and 
  5430.  use it with conditional commands)(&& and ||). 
  5431.  
  5432.  Options 
  5433.  
  5434.     /F:     (Force delete) This option is only available in the 32-bit version 
  5435.             of 4OS2.  It forces deletion of the file without saving it to the 
  5436.             DELDIR directory (if DELDIR is not in use, /F has no effect). 
  5437.  
  5438.     /N:     (Nothing) Do everything except actually delete the file(s).  This 
  5439.             is useful for testing what the result of a DEL would be. 
  5440.  
  5441.     /P:     (Prompt) Prompt the user to confirm each erasure.  Your options at 
  5442.             the prompt are explained in detail under Page and File Prompts. 
  5443.  
  5444.     /Q:     (Quiet) Don't display filenames as they are deleted, or the number 
  5445.             of files deleted or bytes freed.  See also /T. 
  5446.  
  5447.     /S:     (Subdirectories) Delete the specified files in this directory and 
  5448.             all of its subdirectories.  This is like a GLOBAL DEL, and can be 
  5449.             used to delete all the files in a subdirectory tree or even a whole 
  5450.             disk.  It should be used with caution! 
  5451.  
  5452.     /T:     (Total) Don't display filenames as they are deleted, but display 
  5453.             the total number of files deleted plus the amount of free disk 
  5454.             space recovered.  Unlike /Q, the /T option will not speed up 
  5455.             deletions under DOS. 
  5456.  
  5457.     /X:     (Remove empty subdirectories) Remove empty subdirectories after 
  5458.             deleting (only useful when used with /S). 
  5459.  
  5460.     /Y:     (Yes) The reverse of /P -- it assumes a Y response to everything, 
  5461.             including deleting an entire subdirectory tree.  4OS2 normally 
  5462.             prompts before deleting files when the name consists only of 
  5463.             wildcards or a subdirectory name (see above); /Y overrides this 
  5464.             protection, and should be used with extreme caution! 
  5465.  
  5466.     /Z:     (Zap) Delete read-only, hidden, and system files as well as normal 
  5467.             files.  Files with the read-only, hidden, or system attribute set 
  5468.             are normally protected from deletion; /Z overrides this protection, 
  5469.             and should be used with caution.  Because EXCEPT works by hiding 
  5470.             files, /Z will override an EXCEPT command. 
  5471.  
  5472.             For example, to delete the entire subdirectory tree starting with 
  5473.             C:\UTIL, including hidden and read- only files, without prompting 
  5474.             (use this command with CAUTION!): 
  5475.  
  5476.                                 [c:\] del /sxyz c:\util\
  5477.  
  5478.  
  5479. ΓòÉΓòÉΓòÉ 14.15. DELAY - Pause for a specified length of time ΓòÉΓòÉΓòÉ
  5480.  
  5481.  Purpose:    Pause for a specified length of time. 
  5482.  
  5483.  Format:     DELAY [seconds ] 
  5484.  
  5485.              seconds :  The number of seconds to delay. 
  5486.  
  5487.  Usage 
  5488.  
  5489.  DELAY is useful in batch file loops while waiting for something to occur.  To 
  5490.  wait for 10 seconds: 
  5491.  
  5492.           delay 10
  5493.  
  5494.  A simple loop could make a tone with the BEEP command to get the operator's 
  5495.  attention and then DELAY for a few seconds while waiting for the user to 
  5496.  respond. 
  5497.  
  5498.  For delays shorter than one second, use the BEEP command with an inaudible 
  5499.  frequency (below 20 Hz). 
  5500.  
  5501.  You can cancel a delay by pressing Ctrl-C or Ctrl-Break. 
  5502.  
  5503.  
  5504. ΓòÉΓòÉΓòÉ 14.16. DESCRIBE - Create or modify file descriptions ΓòÉΓòÉΓòÉ
  5505.  
  5506.  Purpose:    Create, modify, or delete file and subdirectory descriptions. 
  5507.  
  5508.  Format:     DESCRIBE file ["description" ] ... 
  5509.  
  5510.              file :  The file or files to operate on. 
  5511.              "description" :  The description to attach to the file. 
  5512.  
  5513.  File Selection 
  5514.  
  5515.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  5516.  
  5517.  Usage 
  5518.  
  5519.  DESCRIBE adds descriptions to files and subdirectories.  The descriptions are 
  5520.  displayed by DIR in single-column mode and by SELECT.  Descriptions let you 
  5521.  identify your files in much more meaningful ways than you can in an 
  5522.  eight-character filename. 
  5523.  
  5524.  You enter a description on the command line by typing the DESCRIBE command, 
  5525.  the filename, and the description in quotation marks, like this: 
  5526.  
  5527.           [c:\] describe memo.txt "Memo to Bob about party"
  5528.  
  5529.  If you don't put a description on the command line, DESCRIBE will prompt you 
  5530.  for it: 
  5531.  
  5532.           [c:\] describe memo.txt
  5533.           Describe "memo.txt" : Memo to Bob about party
  5534.  
  5535.  If you use wildcards or multiple filenames with the DESCRIBE command and don't 
  5536.  include the description text, you will be prompted to enter a description for 
  5537.  each file.  If you do include the description on the command line, all 
  5538.  matching files will be given the same description. 
  5539.  
  5540.  Each description can be up to 40 characters long.  You can change this limit 
  5541.  with the DescriptionMax directive in 4OS2.INI.  DESCRIBE can edit descriptions 
  5542.  longer than DescriptionMax (up to a limit of 200 characters), but will not 
  5543.  allow you to lengthen the existing text. 
  5544.  
  5545.  The descriptions are stored in each directory in a hidden file called 
  5546.  DESCRIPT.ION.  Use the ATTRIB command to remove the hidden attribute from this 
  5547.  file if you need to copy or delete it.  (DESCRIPT.ION is always created as a 
  5548.  hidden file, but will not be re-hidden by 4OS2 if you remove the hidden 
  5549.  attribute.) 
  5550.  
  5551.  The description file is modified appropriately whenever you perform an 
  5552.  internal command which affects it (such as COPY, MOVE, DEL, or RENAME), but 
  5553.  not if you use an external program (such as XCOPY or a visual shell). 
  5554.  
  5555.  On HPFS drives, you will not see file descriptions in a normal DIR display, 
  5556.  because DIR must leave space for the long filenames used on these drives.  To 
  5557.  view the descriptions, use DIR /Z to display the directory in FAT format.  See 
  5558.  the DIR command for more details. 
  5559.  
  5560.  
  5561. ΓòÉΓòÉΓòÉ 14.17. DETACH - Start a program in detached mode ΓòÉΓòÉΓòÉ
  5562.  
  5563.  Purpose:    Start an OS/2 program in detached mode. 
  5564.  
  5565.  Format:     DETACH command 
  5566.  
  5567.              command :  The name of a command to execute, including an optional 
  5568.              drive and path specification. 
  5569.  
  5570.  See also:  START. 
  5571.  
  5572.  Usage 
  5573.  
  5574.  When you start a program with DETACH, that program cannot use the keyboard, 
  5575.  mouse, or video display.  It is "detached" from the normal means of user input 
  5576.  and output.  However, you can redirect the program's standard I/O to other 
  5577.  devices if necessary, using redirection symbols. 
  5578.  
  5579.  The command can be an internal command, external command, alias, or batch 
  5580.  file.  If it is not an external command, 4OS2 will detach a copy of itself to 
  5581.  execute the command. 
  5582.  
  5583.  For example, the following command will detach a copy of 4OS2 to run the batch 
  5584.  file XYZ.BTM : 
  5585.  
  5586.           [c:\] detach xyz.btm
  5587.  
  5588.  Once the program has started, 4OS2 returns to the prompt immediately.  It does 
  5589.  not wait for a detached program to finish. 
  5590.  
  5591.  
  5592. ΓòÉΓòÉΓòÉ 14.18. DIR - Display directories ΓòÉΓòÉΓòÉ
  5593.  
  5594.  Purpose:    Display information about files and subdirectories. 
  5595.  
  5596.  Format:     DIR [/1 /2 /4 /A[[:][-]rhsda] /B /D /E /F /H /I"text" /J /K /L /M 
  5597.              /N /O[[:][-]adeginrsu] /P /R /S /T[:acw] /U /V /W /Z] [file...] 
  5598.  
  5599.              file :  The file, directory, or list of files or directories to 
  5600.              display. 
  5601.  
  5602.              /1 (one column)                 /L(ower case) 
  5603.              /2 (two columns)                /M (suppress footer) 
  5604.              /4 (four columns)               /N(ew format) 
  5605.              /A(ttribute select)             /O(rder) 
  5606.              /B(are)                         /P(ause) 
  5607.              /D(isable color coding)         /R (disable wRap) 
  5608.              /E (use upper case)             /S(ubdirectories) 
  5609.              /F(ull path)                    /T (aTtribute) or (Time) 
  5610.              /H(ide dots)                    /U (sUmmary information) 
  5611.              /I (match descriptions)         /V(ertical sort) 
  5612.              /J(ustify names)                /W(ide) 
  5613.              /K (suppress header)            /Z (use FAT format) 
  5614.  
  5615.  See also:  ATTRIB, DESCRIBE, SELECT, and SETDOS. 
  5616.  
  5617.  File Selection 
  5618.  
  5619.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  5620.  
  5621.  Usage 
  5622.  
  5623.  DIR can be used to display information about files from one or more of your 
  5624.  disk directories, in a wide range of formats.  Depending on the options 
  5625.  chosen, you can display the file name, attributes, and size; the time and date 
  5626.  of the last change to the file; the file description; and the file's 
  5627.  compression ratio.  You can also display information in 1, 2, 4, or 5 columns, 
  5628.  sort the files several different ways, use color to distinguish file types, 
  5629.  and pause after each full screen. 
  5630.  
  5631.  The various DIR displays are controlled through options or switches.  The best 
  5632.  way to learn how to use the many options available with the DIR command is to 
  5633.  experiment.  You will soon know which options you want to use regularly.  You 
  5634.  can select those options permanently by using the ALIAS command. 
  5635.  
  5636.  You may want to mix several options.  For example, to display all the files in 
  5637.  the current directory, in 2 columns, sorted vertically (down one column then 
  5638.  down the next), and with a pause at the end of each page: 
  5639.  
  5640.           [c:\] dir /2/p/v
  5641.  
  5642.  To set up this format as the default, using an alias: 
  5643.  
  5644.           [c:\] alias dir=*dir /2/p/v
  5645.  
  5646.  This example displays all the files on all directories of drive C, including 
  5647.  hidden and system files, pausing after each page: 
  5648.  
  5649.           [c:\] dir /s/a/p c:\
  5650.  
  5651.  DIR allows wildcard characters (* and ?) in the filename.  If you don't 
  5652.  specify a filename, DIR defaults to *.* (display all non- hidden files and 
  5653.  subdirectories in the current directory).  To display all of the .WKS files in 
  5654.  the current directory: 
  5655.  
  5656.           [c:\] dir *.wks
  5657.  
  5658.  With the /I option, DIR can select files to display based on their 
  5659.  descriptions.  DIR will display a file if its description matches the text 
  5660.  after the /I switch.  The search is not case sensitive.  You can use wildcards 
  5661.  and extended wildcards as part of the text.  For example, to display any file 
  5662.  described as a " Test File" you can use this command: 
  5663.  
  5664.           [c:\] dir /i"test file"
  5665.  
  5666.  If you want to display files that include the words "test file" anywhere in 
  5667.  their descriptions, use extended wild cards like this: 
  5668.  
  5669.           [c:\] dir /i"*test file*"
  5670.  
  5671.  If you link two or more filenames together with spaces, DIR will display all 
  5672.  of the files that match the first name and then all of the files that match 
  5673.  the second name.  You may use a different drive and path for each filename. 
  5674.  This example lists all of the .WKS and then all of the .WK1 files in the 
  5675.  current directory: 
  5676.  
  5677.           [c:\] dir *.wks *.wk1
  5678.  
  5679.  If you use an include list to link multiple filenames, DIR will display the 
  5680.  matching filenames in a single listing.  Only the first filename in an include 
  5681.  list can have a path; the other files must be in the same path.  This example 
  5682.  displays the same files as the previous example, but the .WKS and .WK1 files 
  5683.  are intermixed: 
  5684.  
  5685.           [c:\] dir *.wks;*.wk1
  5686.  
  5687.  You can display the file and subdirectory names in color by setting the 
  5688.  COLORDIR environment variable or using the ColorDir directive in your .INI 
  5689.  file.  See Color-Coded Directories for details. 
  5690.  
  5691.  If you are using color-coded directories and attempt to redirect the output of 
  5692.  DIR to a character device, such as a serial port or the printer, 
  5693.  non-color-coded file names will be displayed on the device but color-coded 
  5694.  names may still be displayed on the screen. This will not occur if the output 
  5695.  of DIR is redirected to a disk file.  To prevent this problem, use the /D 
  5696.  switch to disable color coding when redirecting the output of DIR to a 
  5697.  character device. 
  5698.  
  5699.  When displaying file descriptions, DIR will wrap long lines to fit on the 
  5700.  screen.  DIR displays a maximum of 40 characters of text in each line of a 
  5701.  description, unless your screen width allows a wider display.  If you disable 
  5702.  description wrapping with the /R switch, the description is truncated at the 
  5703.  right edge of the screen, and a right arrow is added at the end of the line to 
  5704.  alert you to the existence of additional description text. 
  5705.  
  5706.  If you attempt to redirect the output of DIR to a character device, such as a 
  5707.  serial port or the printer, long descriptions will be wrapped at the screen 
  5708.  width in the redirected output.  If this is not what you want, use /R to 
  5709.  disable wrapping. 
  5710.  
  5711.  When sorting file names and extensions, 4OS2 normally assumes that sequences 
  5712.  of digits should be sorted numerically (for example, the file DRAW2 would come 
  5713.  before DRAW03 because 2 is numerically smaller than 03), rather than strictly 
  5714.  alphabetically (where DRAW2 would come second because "2" is after "0" in 
  5715.  alphanumeric order). You can defeat this behavior and force a strict 
  5716.  alphabetic sort with the /O:a option. 
  5717.  
  5718.  If you have selected a specific country code for your system, DIR will display 
  5719.  the date in the format for that country.  The default date format is U.S. 
  5720.  (mm-dd-yy).  The separator character in the file time will also be affected by 
  5721.  the country code. 
  5722.  
  5723.  DIR can handle directories of any size, limited only by available memory. 
  5724.  Memory requirements for DIR are generally not a concern under 4OS2, because of 
  5725.  the virtual memory available under these operating systems. 
  5726.  
  5727.  Options on the command line apply only to the filenames which follow the 
  5728.  option, and options at the end of the line apply to the preceding filename 
  5729.  only.  This allows you to specify different options for different groups of 
  5730.  files, yet retains compatibility with the traditional DIR command when a 
  5731.  single filename is specified. 
  5732.  
  5733.  Options 
  5734.  
  5735.     /1:     Single column display -- display the filename, size, date, time, 
  5736.             and description.  This is the default. If /T is used the attributes 
  5737.             are displayed instead of the description; if /C or /O:c is used the 
  5738.             compression ratio is displayed instead of the description. 
  5739.  
  5740.     /2:     Two column display -- display the filename, size, date, and time. 
  5741.             If you use /2 (or /4) on an HPFS drive, DIR will only display the 
  5742.             file names.  Also, the number of columns may be reduced to one for 
  5743.             names too long to fit on half the screen.  Due to these 
  5744.             restrictions, /2 is normally most useful on HPFS drives when used 
  5745.             with /Z to force the display to FAT format. 
  5746.  
  5747.     /4:     Four column display -- display the filename and size, in K 
  5748.             (kilobytes) or M (megabytes).  The note under /2 above regarding 
  5749.             HPFS drives applies to /4 as well. 
  5750.  
  5751.     /A:     (Attribute select)  Display only those files that have the 
  5752.             specified attribute(s) set.  Preceding the attribute character with 
  5753.             a hyphen [-] will display files that do not have that attribute 
  5754.             set.  The attributes are: 
  5755.  
  5756.               R  Read-only 
  5757.               H  Hidden 
  5758.               S  System 
  5759.               D  Subdirectory 
  5760.               A  Archive 
  5761.  
  5762.             If no attributes are listed at all (e.g., DIR /A), DIR will display 
  5763.             all files and subdirectories including hidden and system files.  If 
  5764.             attributes are combined, all the specified attributes must match 
  5765.             for a file to be included in the listing.  For example, /A:RHS will 
  5766.             display only those files with all three attributes set. 
  5767.  
  5768.     /B:     (Bare)  Suppress the header and summary lines, and display file or 
  5769.             subdirectory names only, in a single column. This option is most 
  5770.             useful when you want to redirect a list of names to a file or 
  5771.             another program.  If you use /B with /S, DIR will show the full 
  5772.             path of each file instead of simply its name and extension. 
  5773.  
  5774.     /D:     (Disable color coding)  Temporarily disable directory color coding. 
  5775.             May be required when color-coded directories are used and DIR 
  5776.             output is redirected to a character device like the printer (e.g., 
  5777.             PRN or LPT1) or serial port (e.g., COM1 or COM2).  /D is not 
  5778.             required when DIR output is redirected to a file. 
  5779.  
  5780.     /E:     Display filenames in the traditional upper case; also see SETDOS /U 
  5781.             and the UpperCase directive in 4OS2.INI.  /E is ignored if the 
  5782.             display is in HPFS format. HPFS file names are always displayed in 
  5783.             the case in which they are stored. 
  5784.  
  5785.     /F:     (Full path)  Display each filename with its drive letter and path 
  5786.             in a single column, without other information. 
  5787.  
  5788.     /H:     (Hide dots)  Suppress the display of the "." and ".." directories. 
  5789.  
  5790.     /I:     Display filenames by matching text in their descriptions.  The text 
  5791.             can include wild cards and extended wildcards.  The search text 
  5792.             must be enclosed in quotation marks.  /I may be used to select 
  5793.             files even if descriptions are not displayed (for example, if /2 is 
  5794.             used).  However, /I will be ignored if /C or /O:c is used. 
  5795.  
  5796.     / J:    (Justify names)  Justify (align) filename extensions and display 
  5797.             them in the traditional format. 
  5798.  
  5799.     /K:     Suppress the header (disk and directory name) display. 
  5800.  
  5801.     /L:     (Lower case)  Display file and directory names in lower case; also 
  5802.             see SETDOS /U and the UpperCase directive in 4OS2.INI.  /L is 
  5803.             ignored if the display is in HPFS format. HPFS file names are 
  5804.             always displayed in the case in which they are stored. 
  5805.  
  5806.     /M:     Suppress the footer (file and byte count totals) display. 
  5807.  
  5808.     /N:     Use the HPFS display format, even if the files are stored on a FAT 
  5809.             file system volume. 
  5810.  
  5811.     /O:     (Order) Set the sorting order.  You may use any combination of the 
  5812.             following sorting options; if multiple options are used, the 
  5813.             listing will be sorted with the first sort option as the primary 
  5814.             key, the next as the secondary key, and so on: 
  5815.  
  5816.               -  Reverse the sort order for the next option 
  5817.               a  Sort in ASCII order, not numerically, when there are digits in 
  5818.             the name 
  5819.               d  Sort by date and time (oldest first); for HPFS drives also see 
  5820.             /T 
  5821.               e  Sort by extension 
  5822.               g  Group subdirectories first, then files 
  5823.               i  Sort by file description (ignored if /C or /O:c is used) 
  5824.               n  Sort by filename (this is the default) 
  5825.               r  Reverse the sort order for all options 
  5826.               s  Sort by size 
  5827.               u  Unsorted 
  5828.  
  5829.     /P:     (Pause)  Wait for a key to be pressed after each screen page before 
  5830.             continuing the display.  Your options at the prompt are explained 
  5831.             in detail under Page and File Prompts. 
  5832.  
  5833.     /R      (disable wRap)  Forces long descriptions to be displayed on a 
  5834.             single line, rather than wrapped onto two or more lines.  Use /R 
  5835.             when output is redirected to a character device, such as a serial 
  5836.             port or the printer; or when you want descriptions truncated, 
  5837.             rather than wrapped, in the on-screen display. 
  5838.  
  5839.     /S:     (Subdirectories)  Display file information from the current 
  5840.             directory and all of its subdirectories.  DIR will only display 
  5841.             headers and summaries for those directories which contain files 
  5842.             that match the filename(s) and attributes (if /A is used) that you 
  5843.             specify on the command line. 
  5844.  
  5845.     /T      (aTtribute display)  Display the filenames and attributes only. 
  5846.             File descriptions are not displayed if /T is used (the attributes 
  5847.             are displayed in place of the descriptions).  /T is ignored if /C 
  5848.             or /O:c is also used.  The attributes are displayed in the format 
  5849.             RHSA, with the following meanings: 
  5850.  
  5851.               R  Read-only 
  5852.               H  Hidden 
  5853.               S  System 
  5854.               A  Archive 
  5855.  
  5856.     /T:acw  (Time display)  Specify which of the date and time fields on an 
  5857.             HPFS drive should be displayed and used for sorting: 
  5858.  
  5859.               a  Last access time 
  5860.               c  Creation time 
  5861.               w  Last write time (default) 
  5862.  
  5863.     /U      (sUmmary information)  Only display the number of files, the total 
  5864.             file size, and the total amount of disk space used. 
  5865.  
  5866.     /V:     (Vertical sort)  Display the filenames sorted vertically rather 
  5867.             than horizontally (use with the /2, /4 or /W options). 
  5868.  
  5869.     /W:     (Wide)  Display filenames only, horizontally across the screen (5 
  5870.             columns on an 80-character wide display). 
  5871.  
  5872.     /Z:     Display an HPFS directory in FAT format.  Long names will be 
  5873.             truncated to 12 characters.  If the name is longer than 12 
  5874.             characters, it will be followed by a right arrow to show that one 
  5875.             or more characters have been truncated. 
  5876.  
  5877.  
  5878. ΓòÉΓòÉΓòÉ 14.19. DIRS - Display the directory stack ΓòÉΓòÉΓòÉ
  5879.  
  5880.  Purpose:    Display the current directory stack. 
  5881.  
  5882.  Format:     DIRS 
  5883.  
  5884.  See also:  PUSHD and POPD. 
  5885.  
  5886.  Usage 
  5887.  
  5888.  The PUSHD command adds the current default drive and directory to the 
  5889.  directory stack, a list that 4OS2 maintains in memory.  The POPD command 
  5890.  removes the top entry of the directory stack and makes that drive and 
  5891.  directory the new default.  The DIRS command displays the contents of the 
  5892.  directory stack, with the most recent entries on top (i.e., the next POPD will 
  5893.  retrieve the first entry that DIRS displays). 
  5894.  
  5895.  The directory stack holds 255 characters, enough for 10 to 20 typical drive 
  5896.  and directory entries. 
  5897.  
  5898.  
  5899. ΓòÉΓòÉΓòÉ 14.20. DO - Create loops in batch files ΓòÉΓòÉΓòÉ
  5900.  
  5901.  Purpose:    Create loops in batch files. 
  5902.  
  5903.  Format:     DO [n | FOREVER] 
  5904.                 or 
  5905.              DO varname = start TO end [BY n ] 
  5906.                 or 
  5907.              DO [WHILE | UNTIL] condition 
  5908.                 ... 
  5909.              [ITERATE] 
  5910.              [LEAVE] 
  5911.                 ... 
  5912.              ENDDO 
  5913.  
  5914.              n, start, end :  An integer between 0 and 2,147,483,647 inclusive, 
  5915.              or an internal variable or variable function that evaluates to 
  5916.              such a value. 
  5917.              varname :  The environment variable that will hold the loop 
  5918.              counter. 
  5919.              condition :  A test to determine if the loop should be executed. 
  5920.  
  5921.  Usage 
  5922.  
  5923.  DO can only be used in batch files. 
  5924.  
  5925.  DO can be used to create 3 different kinds of loops.  The first, introduced by 
  5926.  DO n, is a counted loop.  The batch file lines between DO and ENDDO are 
  5927.  repeated n times.  You can also specify "forever" for n if you wish to create 
  5928.  an endless loop. For example: 
  5929.  
  5930.           do 5
  5931.              beep
  5932.           enddo
  5933.  
  5934.  The second type of loop is similar to a "for loop" in programming languages 
  5935.  like BASIC.  DO creates an environment variable, varname, and sets it equal to 
  5936.  the value start (if varname already exists in the environment, it will be 
  5937.  overwritten).  DO then begins the loop process by comparing the value of 
  5938.  varname with the value of end.  If varname is less than or equal to end, DO 
  5939.  executes the batch file lines up to the ENDDO.  Next, DO adds 1 to the value 
  5940.  of varname, or adds the value n if BY n is specified, and repeats the compare 
  5941.  and execute process until varname is greater than end. This example displays 
  5942.  the even numbers from 2 through 20: 
  5943.  
  5944.           do i = 2 to 20 by 2
  5945.              echo %i
  5946.           enddo
  5947.  
  5948.  DO can also count down, rather than up.  If n is negative, varname will 
  5949.  decrease by n with each loop, and the loop will stop when varname is less than 
  5950.  end.  For example, to display the even numbers from 2 through 20 in reverse 
  5951.  order, replace the first line of the example above with: 
  5952.  
  5953.           do i = 20 to 2 by -2
  5954.  
  5955.  The third type of loop is called a "while loop" or "until loop." DO evaluates 
  5956.  the condition, which can be any of the tests supported by the IF command, and 
  5957.  executes the lines between DO and ENDDO as long as the condition is true.  The 
  5958.  loop ends when the condition becomes false. 
  5959.  
  5960.  WHILE tests the condition at the start of the loop; UNTIL tests it at the end. 
  5961.  If you use WHILE, the loop may never be executed (if the condition is false at 
  5962.  the start of the loop); if you use UNTIL, the loop will always be executed at 
  5963.  least once. 
  5964.  
  5965.  Two special commands, ITERATE and LEAVE, can only be used inside a DO / ENDDO 
  5966.  loop.  ITERATE ignores the remaining lines inside the loop and returns to the 
  5967.  beginning of loop for another iteration (unless DO determines that the loop is 
  5968.  finished).  LEAVE exits from the current DO loop and continues with the line 
  5969.  following ENDDO. Both ITERATE and LEAVE are most often used in an IF or IFF 
  5970.  command: 
  5971.  
  5972.           do while "%var" != "%val1"
  5973.              ...
  5974.              if "%var" == "%val2" leave
  5975.           enddo
  5976.  
  5977.  You can nest DO loops up to 15 levels deep. 
  5978.  
  5979.  You can exit from all DO / ENDDO loops by using GOTO to a line past the last 
  5980.  ENDDO.  However, be sure to read the cautionary notes about GOTO and DO under 
  5981.  the GOTO command before using a GOTO inside any DO loop. 
  5982.  
  5983.  
  5984. ΓòÉΓòÉΓòÉ 14.21. DPATH - Set the data search path ΓòÉΓòÉΓòÉ
  5985.  
  5986.  Purpose:    Specify the subdirectories which applications will search to find 
  5987.              files that are not in the current directory. 
  5988.  
  5989.  Format:     DPATH [directory [;directory... ]] 
  5990.  
  5991.              directory :  The full name of a directory to include in the DPATH 
  5992.              (data path) setting. 
  5993.  
  5994.  See also:  PATH, SET, and ESET. 
  5995.  
  5996.  Usage 
  5997.  
  5998.  When most OS/2 applications try to open a data file, they look for the file in 
  5999.  the current directory first.  If they fail to find the file there, they search 
  6000.  each of the directories in the DPATH setting in the order that they are 
  6001.  included.  Internal commands like TYPE do not search the DPATH directories for 
  6002.  files. 
  6003.  
  6004.  For example, the following DPATH command directs applications to look for 
  6005.  files in this order:  the current directory, the INIT directory on C, and the 
  6006.  CONFIG directory on D: 
  6007.  
  6008.           [c:\] dpath c:\init;d:\config
  6009.  
  6010.  The listing of directories to be searched can be set or viewed with DPATH. 
  6011.  The list is stored as an environment string with the variable name DPATH, and 
  6012.  can also be set or viewed with the SET command and edited with the ESET 
  6013.  command. 
  6014.  
  6015.  Directory names in the DPATH must be separated with semicolons [;].  4OS2 will 
  6016.  not shift directory names in the DPATH to upper case as it does with those in 
  6017.  the PATH setting.  If you want the names in the DPATH to be in upper case you 
  6018.  must enter them that way. 
  6019.  
  6020.  If you enter DPATH with no parameters, 4OS2 displays the current DPATH search 
  6021.  list. 
  6022.  
  6023.  
  6024. ΓòÉΓòÉΓòÉ 14.22. DRAWBOX - Draw a box ΓòÉΓòÉΓòÉ
  6025.  
  6026.  Purpose:    Draw a box on the screen. 
  6027.  
  6028.  Format:     DRAWBOX ulrow ulcol lrrow lrcol style [BRIght] [BLInk] fg ON 
  6029.              [BRIght] bg [FILl bgfill ] [ZOOm] [SHAdow] 
  6030.  
  6031.              ulrow :  Row for upper left corner 
  6032.              ulcol :  Column for upper left corner 
  6033.              lrrow :  Row for lower right corner 
  6034.              lrcol :  Column for lower right corner 
  6035.              style :  Box drawing style: 
  6036.              0   No lines (box is drawn with blanks) 
  6037.              1   Single line 
  6038.              2   Double line 
  6039.              3   Single line on top and bottom, double on sides 
  6040.              4   Double line on top and bottom, single on sides 
  6041.              fg :  Foreground character color 
  6042.              bg :  Background character color 
  6043.              bgfill :  Background fill color (for the inside of the box) 
  6044.  
  6045.  See also:  DRAWHLINE and DRAWVLINE. 
  6046.  
  6047.  Usage 
  6048.  
  6049.  DRAWBOX is useful for creating attractive screen displays in batch files. 
  6050.  
  6051.  For example, to draw a box around the entire screen with bright white lines on 
  6052.  a blue background: 
  6053.  
  6054.           drawbox 0 0 24 79 1 bri whi on blu fill blu
  6055.  
  6056.  See Colors and Color Names for details about colors and notes on the use of 
  6057.  bright background colors. 
  6058.  
  6059.  If you use ZOOM, the box appears to grow in steps to its final size.  The 
  6060.  speed of the zoom operation depends on the speed of your video system. 
  6061.  
  6062.  If you use SHADOW, a drop shadow is created by changing the characters in the 
  6063.  row under the box and the 2 columns to the right of the box to normal 
  6064.  intensity text with a black background (this will make characters displayed in 
  6065.  black disappear entirely). 
  6066.  
  6067.  The row and column values are zero-based, so on a standard 25 line by 80 
  6068.  column display, valid rows are 0 - 24 and valid columns are 0 - 79. 
  6069.  
  6070.  DRAWBOX checks for valid row and column values, and displays a "Usage" error 
  6071.  message if any values are out of range. 
  6072.  
  6073.  Unlike DRAWHLINE and DRAWVLINE, DRAWBOX does not automatically connect boxes 
  6074.  to existing lines on the screen with the proper connector characters.  If you 
  6075.  want to draw lines inside a box and have the proper connectors drawn 
  6076.  automatically, draw the box first, then use DRAWHLINE and DRAWVLINE to draw 
  6077.  the lines. 
  6078.  
  6079.  DRAWBOX uses the standard line and box drawing characters in the U.S. English 
  6080.  extended ASCII character set.  If your system is configured for a different 
  6081.  country or language, the box may not appear on your screen as you expect. 
  6082.  
  6083.  
  6084. ΓòÉΓòÉΓòÉ 14.23. DRAWHLINE - Draw a horizontal line ΓòÉΓòÉΓòÉ
  6085.  
  6086.  Purpose:    Draw a horizontal line on the screen. 
  6087.  
  6088.  Format:     DRAWHLINE row column len style [BRIght] [BLInk] fg ON [BRIght] bg 
  6089.  
  6090.              row :  Starting row 
  6091.              column :  Starting column 
  6092.              len :  Length of line 
  6093.              style :  Line drawing style: 
  6094.              1   Single line 
  6095.              2   Double line 
  6096.              fg :  Foreground character color 
  6097.              bg :  Background character color 
  6098.  
  6099.  See also:  DRAWBOX and DRAWVLINE. 
  6100.  
  6101.  Usage 
  6102.  
  6103.  DRAWHLINE is useful for creating attractive screen displays in batch files. 
  6104.  It detects other lines and boxes on the display, and creates the appropriate 
  6105.  connector characters when possible (not all types of lines can be connected 
  6106.  with the available characters). 
  6107.  
  6108.  For example, the following command draws a double line along the top row of 
  6109.  the display with green characters on a blue background: 
  6110.  
  6111.           drawhline 0 0 80 2 green on blue
  6112.  
  6113.  The row and column values are zero-based, so on a standard 25 line by 80 
  6114.  column display, valid rows are 0 - 24 and valid columns are 0 - 79.  DRAWHLINE 
  6115.  checks for a valid row and column, and displays a "Usage" error message if 
  6116.  either value is out of range. 
  6117.  
  6118.  See Colors and Color Names for details about colors and notes on the use of 
  6119.  bright background colors. 
  6120.  
  6121.  DRAWHLINE uses the standard line and box drawing characters in the U.S. 
  6122.  English extended ASCII character set.  If your system is configured for a 
  6123.  different country or language, the line may not appear on your screen as you 
  6124.  expect. 
  6125.  
  6126.  
  6127. ΓòÉΓòÉΓòÉ 14.24. DRAWVLINE - Draw a vertical line ΓòÉΓòÉΓòÉ
  6128.  
  6129.  Purpose:    Draw a vertical line on the screen. 
  6130.  
  6131.  Format:     DRAWVLINE row column len style [BRIght][BLInk] fg ON [BRIght] bg 
  6132.  
  6133.              row :  Starting row 
  6134.              column :  Starting column 
  6135.              len :  Length of line 
  6136.              style :  Line drawing style: 
  6137.              1   Single line 
  6138.              2   Double line 
  6139.              fg :  Foreground character color 
  6140.              bg :  Background character color 
  6141.  
  6142.  See also:  DRAWBOX and DRAWHLINE. 
  6143.  
  6144.  Usage 
  6145.  
  6146.  DRAWVLINE is useful for creating attractive screen displays in batch files. 
  6147.  It detects other lines and boxes on the display, and creates the appropriate 
  6148.  connector characters when possible (not all types of lines can be connected 
  6149.  with the available characters). 
  6150.  
  6151.  For example, to draw a double width line along the left margin of the display 
  6152.  with bright red characters on a black background: 
  6153.  
  6154.           drawvline 0 0 25 2 bright red on black
  6155.  
  6156.  The row and column values are zero-based, so on a standard 25 line by 80 
  6157.  column display, valid rows are 0 - 24 and valid columns are 0 - 79.  DRAWVLINE 
  6158.  checks for a valid row and column, and displays a "Usage" error message if 
  6159.  either value is out of range. 
  6160.  
  6161.  See Colors and Color Names for details about colors and notes on the use of 
  6162.  bright background colors. 
  6163.  
  6164.  DRAWVLINE uses the standard line and box drawing characters in the U.S. 
  6165.  English extended ASCII character set.  If your system is configured for a 
  6166.  different country or language, the line may not appear on your screen as you 
  6167.  expect. 
  6168.  
  6169.  
  6170. ΓòÉΓòÉΓòÉ 14.25. ECHO - Display a message / set echo state ΓòÉΓòÉΓòÉ
  6171.  
  6172.  Purpose:    Display a message, enable or disable batch file or command-line 
  6173.              echoing, or display the echo status. 
  6174.  
  6175.  Format:     ECHO [ON | OFF | message ] 
  6176.  
  6177.              message :  Text to display. 
  6178.  
  6179.  See also:  ECHOS, SCREEN, SCRPUT, SETDOS and TEXT. 
  6180.  
  6181.  Usage 
  6182.  
  6183.  4OS2 has a separate echo capability for batch files and for the command line. 
  6184.  The command-line ECHO state is independent of the batch file ECHO state; 
  6185.  changing ECHO in a batch file has no effect on the display at the command 
  6186.  prompt, and vice versa. 
  6187.  
  6188.  To see the current echo state, use the ECHO command with no arguments.  This 
  6189.  displays either the batch file or command-line echo state, depending on where 
  6190.  the ECHO command is performed. 
  6191.  
  6192.  In a batch file, if you turn ECHO on, each line of the file is displayed 
  6193.  before it is executed.  If you turn ECHO off, each line is executed without 
  6194.  being displayed.  ECHO can also be used in a batch file to display a message 
  6195.  on the screen.  Regardless of the ECHO state, a batch file line that begins 
  6196.  with the [@] character will not be displayed.  To turn off batch file echoing, 
  6197.  without displaying the ECHO command, use this line: 
  6198.  
  6199.           @echo off
  6200.  
  6201.  ECHO commands in a batch file will send messages to the screen while the batch 
  6202.  file executes, even if ECHO is set OFF.  For example, this line will display a 
  6203.  message in a batch file: 
  6204.  
  6205.           echo Processing your print files...
  6206.  
  6207.  If you want to echo a blank line from within a batch file, enter: 
  6208.  
  6209.           echo.
  6210.  
  6211.  You cannot use the command separator character [&], or the redirection symbols 
  6212.  [| > <] in an ECHO message, unless you enclose them in quotes (see Argument 
  6213.  Quoting) or precede them with the escape character. 
  6214.  
  6215.  ECHO defaults to ON in batch files.  The current ECHO state is inherited by 
  6216.  called batch files.  You can change the default setting to ECHO OFF with the 
  6217.  SETDOS /V0 command or the BatchEcho directive in the .INI file. 
  6218.  
  6219.  If you turn the command-line ECHO on, each command will be displayed before it 
  6220.  is executed.  This will let you see the command line after expansion of all 
  6221.  aliases and variables.  The command- line ECHO is most useful when you are 
  6222.  learning how to use advanced features.  This example will turn command-line 
  6223.  echoing on: 
  6224.  
  6225.           [c:\] echo on
  6226.  
  6227.  ECHO defaults to OFF at the command line. 
  6228.  
  6229.  
  6230. ΓòÉΓòÉΓòÉ 14.26. ECHOS - Display a message without CR/LF ΓòÉΓòÉΓòÉ
  6231.  
  6232.  Purpose:    Display a message without a trailing carriage return and line 
  6233.              feed. 
  6234.  
  6235.  Format:     ECHOS message 
  6236.  
  6237.  See also:  ECHO, SCREEN, SCRPUT, TEXT, and VSCRPUT. 
  6238.  
  6239.  Usage 
  6240.  
  6241.  ECHOS is useful for text output when you don't want to add a carriage return / 
  6242.  linefeed pair at the end of the line.  For example, you can use ECHOS when you 
  6243.  need to redirect control sequences to your printer; this example sends the 
  6244.  sequence Esc P to the printer on LPT1: 
  6245.  
  6246.           [c:\] echos ^eP > lpt1:
  6247.  
  6248.  You cannot use the command separator character [&] or the redirection symbols 
  6249.  [| > <] in an ECHOS message, unless you enclose them in quotes (see Argument 
  6250.  Quoting) or precede them with the escape character. 
  6251.  
  6252.  ECHOS does not translate or modify the message text.  For example, carriage 
  6253.  return characters are not translated to CR/LF pairs. ECHOS sends only the 
  6254.  characters you enter (after escape character and back quote processing).  The 
  6255.  only character you cannot put into an ECHOS message is the NUL character 
  6256.  (ASCII 0). 
  6257.  
  6258.  
  6259. ΓòÉΓòÉΓòÉ 14.27. ENDLOCAL - Restore the saved environment ΓòÉΓòÉΓòÉ
  6260.  
  6261.  Purpose:    Restore the saved disk drive, directory, environment, and alias 
  6262.              list. 
  6263.  
  6264.  Format:     ENDLOCAL 
  6265.  
  6266.  See also:  SETLOCAL. 
  6267.  
  6268.  Usage 
  6269.  
  6270.  The SETLOCAL command in a batch file saves the current disk drive, default 
  6271.  directory, all environment variables, and the alias list. ENDLOCAL restores 
  6272.  everything that was saved by the previous SETLOCAL command. 
  6273.  
  6274.  SETLOCAL and ENDLOCAL can only be used in batch files, not in aliases or from 
  6275.  the command line. 
  6276.  
  6277.  
  6278. ΓòÉΓòÉΓòÉ 14.28. ESET - Edit environment variables and aliases ΓòÉΓòÉΓòÉ
  6279.  
  6280.  Purpose:    Edit environment variables and aliases. 
  6281.  
  6282.  Format:     ESET [/A] variable name... 
  6283.  
  6284.              variable name :  The name of an environment variable or alias to 
  6285.              edit. 
  6286.  
  6287.              /A(lias) 
  6288.  
  6289.  See also:  ALIAS, UNALIAS, SET, and UNSET. 
  6290.  
  6291.  Usage 
  6292.  
  6293.  ESET allows you to edit environment variables and aliases using line editing 
  6294.  commands (see Command-Line Editing). 
  6295.  
  6296.  For example, to edit the executable file search path: 
  6297.  
  6298.           [c:\] eset path
  6299.           path=c:\;c:\dos;c:\util
  6300.  
  6301.  To create and then edit an alias: 
  6302.  
  6303.           [c:\] alias d = dir /d/j/p
  6304.           [c:\] eset d
  6305.           d=dir /d/j/p
  6306.  
  6307.  ESET will search for environment variables first and then aliases. If you have 
  6308.  an environment variable and an alias with the same name, ESET will edit the 
  6309.  environment variable and ignore the alias unless you use the /A option. 
  6310.  
  6311.  Environment variable and alias names are normally limited to 80 characters, 
  6312.  and their contents to 1,023 characters.  However, if you use special 
  6313.  techniques to create a longer environment variable, ESET will edit it provided 
  6314.  the variable contains no more than 2,047 characters of text. 
  6315.  
  6316.  If you have enabled global aliases (see ALIAS), any changes made to an alias 
  6317.  with ESET will immediately affect all other copies of 4OS2 which are using the 
  6318.  same alias list. 
  6319.  
  6320.  Option 
  6321.  
  6322.     /A:     (Alias) Edit the named alias even if an environment variable of the 
  6323.             same name exists.  If you have an alias and an environment variable 
  6324.             with the same name, you must use this switch to be able to edit the 
  6325.             alias. 
  6326.  
  6327.  
  6328. ΓòÉΓòÉΓòÉ 14.29. EXCEPT - Exclude files from a command ΓòÉΓòÉΓòÉ
  6329.  
  6330.  Purpose:    Perform a command on all available files except those specified. 
  6331.  
  6332.  Format:     EXCEPT (file ) command 
  6333.  
  6334.              file :  The file or files to exclude from the command. 
  6335.              command :  The command to execute, including all appropriate 
  6336.              arguments and switches. 
  6337.  
  6338.  See also:  ATTRIB. 
  6339.  
  6340.  File Selection 
  6341.  
  6342.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  6343.  Date, time, or size ranges must appear immediately after the EXCEPT keyword. 
  6344.  
  6345.  Usage 
  6346.  
  6347.  EXCEPT provides a means of executing a command on a group of files and/or 
  6348.  subdirectories, and excluding a subgroup from the operation. The command can 
  6349.  be an internal command or alias, an external command, or a batch file. 
  6350.  
  6351.  You may use wildcards to specify the files to exclude from the command.  The 
  6352.  first example erases all the files in the current directory except those 
  6353.  beginning with MEMO, and those whose extension is .WKS.  The second example 
  6354.  copies all the files and subdirectories on drive C to drive D except those in 
  6355.  C:\MSC and C:\DOS, using the COPY command: 
  6356.  
  6357.           [c:\] except (memo*.* *.wks) erase *.*
  6358.           [c:\] except (c:\msc c:\dos) copy c:\*.* d:\ /s
  6359.  
  6360.  Date, time, and size ranges can be used immediately after the word EXCEPT to 
  6361.  further qualify which files should be excluded from the command.  If the 
  6362.  command is an internal command that supports ranges, an independent range can 
  6363.  also be used in the command itself. 
  6364.  
  6365.  EXCEPT prevents operations on the specified file(s) by setting the hidden 
  6366.  attribute, performing the command, and then clearing the hidden attribute.  If 
  6367.  the command is aborted in an unusual way, you may need to use the ATTRIB 
  6368.  command to remove the hidden attribute from the file(s). 
  6369.  
  6370.  Caution:  EXCEPT will not work with programs or commands that ignore the 
  6371.  hidden attribute or which work explicitly with hidden files, including DEL /Z, 
  6372.  and the /H (process hidden files) switch available in some 4OS2 file 
  6373.  processing commands. 
  6374.  
  6375.  You can use command grouping to execute multiple commands with a single 
  6376.  EXCEPT.  For example, the following command copies all files in the current 
  6377.  directory whose extensions begin with .DA, except the .DAT files, to the 
  6378.  D:\SAVE directory, then changes the first two characters of the extension of 
  6379.  the copied files to .SA: 
  6380.  
  6381.           [c:\data] except (*.dat) (copy *.da* d:\save & ren *.da* *.sa*)
  6382.  
  6383.  If you use filename completion (see Filename Completion) to enter the 
  6384.  filenames inside the parentheses, type a space after the open parenthesis 
  6385.  before entering a partial filename or pressing Tab.  Otherwise, the 
  6386.  command-line editor will treat the open parenthesis as the first character of 
  6387.  the filename to be completed. 
  6388.  
  6389.  
  6390. ΓòÉΓòÉΓòÉ 14.30. EXIT - Exit 4OS2 ΓòÉΓòÉΓòÉ
  6391.  
  6392.  Purpose:    Return from 4OS2. 
  6393.  
  6394.  Format:     EXIT [value ] 
  6395.  
  6396.              value :  The exit code to return (0 - 255). 
  6397.  
  6398.  Usage 
  6399.  
  6400.  EXIT terminates the current copy of 4OS2.  Use it to return to an application 
  6401.  when you have "shelled out" to work at the prompt, or to end an OS/2 
  6402.  command-line session. 
  6403.  
  6404.  To close the session, or to return to the application that started 4OS2, type: 
  6405.  
  6406.           [c:\] exit
  6407.  
  6408.  If you specify a value, EXIT will return that value to the program that 
  6409.  started 4OS2.  For example: 
  6410.  
  6411.           [c:\] exit 255
  6412.  
  6413.  The value is a number you can use to inform the program of some result, such 
  6414.  as the success or failure of a batch file.  This feature is most useful for 
  6415.  systems which use batch files to automate their operation, such as bulletin 
  6416.  boards, or custom application programs like databases that shell to 4OS2 to 
  6417.  perform certain tasks. 
  6418.  
  6419.  
  6420. ΓòÉΓòÉΓòÉ 14.31. FOR - Repeat a command ΓòÉΓòÉΓòÉ
  6421.  
  6422.  Purpose:    Repeat a command for several values of a variable. 
  6423.  
  6424.  Format:     FOR [/A[[:][-]rhsda]] %var IN ([@]set ) [DO] command ... 
  6425.  
  6426.              %var :  The variable to be used in the command ("FOR variable"). 
  6427.              set :  A set of values for the variable. 
  6428.              command :  A command or group of commands to be executed for each 
  6429.              value of the variable. 
  6430.  
  6431.              /A(ttribute select) 
  6432.  
  6433.  File Selection 
  6434.  
  6435.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  6436.  Date, time, or size ranges must appear immediately after the FOR keyword. 
  6437.  
  6438.  Usage 
  6439.  
  6440.  FOR begins by creating a set.  It then executes a command for every member of 
  6441.  the set.  The command can be an internal command, an alias, an external 
  6442.  command, or a batch file. 
  6443.  
  6444.  Normally, the set is a list of files specified with wildcards.  For example, 
  6445.  if you use this line in a batch file: 
  6446.  
  6447.           for %x in (*.txt) do list %x
  6448.  
  6449.  then LIST will be executed once for each file in the current directory with 
  6450.  the extension .TXT.  The FOR variable %x is set equal to each of the file 
  6451.  names in turn, then the LIST command is executed for each file.  (You could do 
  6452.  the same thing more easily with a simple LIST *.TXT.  We used FOR here so you 
  6453.  could get a feel for how it operates, using a simple example.) 
  6454.  
  6455.  The set can include multiple files or an include list, like this: 
  6456.  
  6457.           for %x in (d:\*.txt;*.doc;*.asc) do type %x
  6458.  
  6459.  If the set includes filenames, the file list can be further refined by using 
  6460.  date, time, and size ranges.  The range must be placed immediately after the 
  6461.  word FOR.  The range will be ignored if no wildcards are used inside the 
  6462.  parentheses.  For example, this set is made up of all of the *.TXT files that 
  6463.  were created or updated on October 4, 1993: 
  6464.  
  6465.           for /[d10-4-93,+0] %x in (*.txt) do ...
  6466.  
  6467.  If the command is an internal command that supports ranges, an independent 
  6468.  range can also be used in the command itself. 
  6469.  
  6470.  The set can also be made up of text instead of file names.  For example, to 
  6471.  display the free space on drives C:, D:, and E:, you could use: 
  6472.  
  6473.           for %drive in (c d e) do free %drive:
  6474.  
  6475.  When the set is made up of text or several separate file names (not an include 
  6476.  list), the elements must be separated by spaces, tabs, commas, or the switch 
  6477.  character (normally a slash [/]). 
  6478.  
  6479.  You can also set the FOR variable equal to each line in a file by placing an 
  6480.  [@] in front of the file name.  If you have a file called DRIVES.TXT that 
  6481.  contains a list of drives on your computer, one drive name per line (with a 
  6482.  ":" after each drive letter), you can print the free space on each drive this 
  6483.  way: 
  6484.  
  6485.           for %d in (@drives.txt) do free %d > prn
  6486.  
  6487.  Because the [@] is also a valid filename character, FOR first checks to see if 
  6488.  the file exists with the [@] in its name (i.e., a file named @DRIVES.TXT ). 
  6489.  If so, the filename is treated as a normal argument.  If it doesn't exist, FOR 
  6490.  uses the filename (without the [@]) as the file from which to retrieve text. 
  6491.  
  6492.  You can use either % or %% in front of the variable name. Either form will 
  6493.  work, whether the FOR command is typed from the command line or is part of an 
  6494.  alias or batch file (some of the traditional command processors require a 
  6495.  single % if FOR is used at the command line, but use %% if it is used in a 
  6496.  batch file).  The variable name can be up to 80 characters long.  The word DO 
  6497.  is optional. 
  6498.  
  6499.  If you use a single-character FOR variable name, that name is given priority 
  6500.  over any environment variable which starts with the same letter, in order to 
  6501.  maintain compatibility with the traditional FOR command.  For example, the 
  6502.  following command tries to add a: and b: to the end of the PATH, but will not 
  6503.  work as intended: 
  6504.  
  6505.           [c:\] for %p in (a: b:) do path %path;%p
  6506.  
  6507.  The "%p" in "%path" will be interpreted as the FOR variable %p followed by the 
  6508.  text "ath", which is not what was intended.  To get around this, use a 
  6509.  different letter or a longer name for the FOR variable, or use square brackets 
  6510.  around the variable name (see Environment). 
  6511.  
  6512.  The following example uses FOR with variable functions to delete the .BAK 
  6513.  files for which a corresponding .TXT file exists in the current directory: 
  6514.  
  6515.           [c:\docs] for %file in (*.txt) do del %@name[%file].bak
  6516.  
  6517.  You can use command grouping to execute multiple commands for each element in 
  6518.  the list.  For example, the following command copies each .WKQ file in the 
  6519.  current directory to the D:\WKSAVE directory, then changes the extension of 
  6520.  each file in the current directory to .SAV.  This should be entered on one 
  6521.  line: 
  6522.  
  6523.           [c:\text] for %file in (*.wkq) do (copy %file d:\wksave\ &
  6524.                     ren %file *.sav)
  6525.  
  6526.  In a batch file you can use GOSUB to execute a subroutine for every element in 
  6527.  the set.  Within the subroutine, the FOR variable can be used just like any 
  6528.  environment variable.  This is a convenient way to execute a complex sequence 
  6529.  of commands for every element in the set without CALLing another batch file. 
  6530.  
  6531.  One unusual use of FOR is to execute a collection of batch files or other 
  6532.  commands with the same parameter.  For example, you might want to have three 
  6533.  batch files all operate on the same data file. The FOR command could look like 
  6534.  this: 
  6535.  
  6536.           [c:\] for %cmd in (filetest fileform fileprnt) do %cmd datafile
  6537.  
  6538.  This line will expand to three separate commands: 
  6539.  
  6540.           filetest datafile
  6541.           fileform datafile
  6542.           fileprnt datafile
  6543.  
  6544.  The variable that FOR uses (the %CMD in the example above) is created in the 
  6545.  environment and then erased when the FOR command is done.  However, for 
  6546.  compatibility with CMD.EXE, single-character FOR variables do not overwrite 
  6547.  existing environment variables with the same name.  As a result, when using a 
  6548.  multi-character variable name you must be careful not to use the name of one 
  6549.  of your environment variables as a FOR variable.  For example, a command that 
  6550.  begins 
  6551.  
  6552.           [c:\] for %path in ...
  6553.  
  6554.  will write over your current path setting and then erase the path variable 
  6555.  completely. 
  6556.  
  6557.  FOR statements can be nested. 
  6558.  
  6559.  Options 
  6560.  
  6561.     /A:     (Attribute select) Process only those files that have the specified 
  6562.             attribute(s).  /A will be used only when processing wildcard file 
  6563.             names in the set.  It will be ignored for filenames without 
  6564.             wildcards or other items in the set.  Preceding the attribute 
  6565.             character with a hyphen [-] will process files that do not have 
  6566.             that attribute set.  The attributes are: 
  6567.  
  6568.               R  Read-only 
  6569.               H  Hidden 
  6570.               S  System 
  6571.               D  Subdirectory 
  6572.               A  Archive 
  6573.  
  6574.             If no attributes are listed (e.g., FOR /A ...), FOR will process 
  6575.             all files including hidden and system files.  If attributes are 
  6576.             combined, all the specified attributes must match for a file to be 
  6577.             included.  For example, /A:RHS will include only those files with 
  6578.             all three attributes set. 
  6579.  
  6580.             For example, to process only those files with the archive attribute 
  6581.             set: 
  6582.  
  6583.                                 for /a:a %f in (*.*) echo %f needs a backup!
  6584.  
  6585.  
  6586. ΓòÉΓòÉΓòÉ 14.32. FREE - Display total and free disk space ΓòÉΓòÉΓòÉ
  6587.  
  6588.  Purpose:    Display the total disk space, total bytes used, and total bytes 
  6589.              free on the specified (or default) drive(s). 
  6590.  
  6591.  Format:     FREE [drive: ... ] 
  6592.  
  6593.              drive :  One or more drives to include in the report. 
  6594.  
  6595.  See also:  MEMORY. 
  6596.  
  6597.  Usage 
  6598.  
  6599.  FREE provides the same disk information as the external command CHKDSK, but 
  6600.  without the wait, since it does not check the integrity of the file and 
  6601.  directory structure of the disk. 
  6602.  
  6603.  A colon [:] is required after each drive letter.  This example displays the 
  6604.  status of drives A and C: 
  6605.  
  6606.           [c:\] free a: c:
  6607.  
  6608.  
  6609. ΓòÉΓòÉΓòÉ 14.33. GLOBAL - Execute a command all subdirectories ΓòÉΓòÉΓòÉ
  6610.  
  6611.  Purpose:    Execute a command in the current directory and its subdirectories. 
  6612.  
  6613.  Format:     GLOBAL [/H /I /P /Q] command 
  6614.  
  6615.              command :  The command to execute, including arguments and 
  6616.              switches. 
  6617.  
  6618.              /H(idden directories)           /P(rompt) 
  6619.              /I(gnore exit codes)            /Q(uiet) 
  6620.  
  6621.  Usage 
  6622.  
  6623.  GLOBAL performs the command first in the current directory and then in every 
  6624.  subdirectory under the current directory.  The command can be an internal 
  6625.  command, an alias, an external command, or a batch file. 
  6626.  
  6627.  This example copies the files in every directory on drive A to the directory 
  6628.  C:\TEMP : 
  6629.  
  6630.           [a:\] global copy *.* c:\temp
  6631.  
  6632.  If you use the /P option, GLOBAL will prompt for each subdirectory before 
  6633.  performing the command.  You can use this option if you want to perform the 
  6634.  command in most, but not all subdirectories of the current directory. 
  6635.  
  6636.  You can use command grouping to execute multiple commands in each 
  6637.  subdirectory.  For example, the following command copies each .TXT file in the 
  6638.  current directory and all of its subdirectories to drive A.  It then changes 
  6639.  the extension of each of the copied files to .SAV : 
  6640.  
  6641.           [c:\] global (copy *.txt a: & ren *.txt *.sav)
  6642.  
  6643.  Options 
  6644.  
  6645.     /H:     (Hidden directories) Forces GLOBAL to look for hidden directories. 
  6646.             If you don't use this switch, hidden directories are ignored. 
  6647.  
  6648.     /I:     (Ignore exit codes) If this option is not specified, GLOBAL will 
  6649.             terminate if the command returns a non- zero exit code.  Use /I if 
  6650.             you want command to continue in additional subdirectories even if 
  6651.             it returns an error in a previous subdirectory.  Even if you use 
  6652.             /I, GLOBAL will halt execution in response to Ctrl-C or Ctrl-Break. 
  6653.  
  6654.     /P:     (Prompt) Forces GLOBAL to prompt with each directory name before it 
  6655.             performs the command.  Your options at the prompt are explained in 
  6656.             detail under Page and File Prompts. 
  6657.  
  6658.     /Q:     (Quiet) Do not display the directory names as each directory is 
  6659.             processed. 
  6660.  
  6661.  
  6662. ΓòÉΓòÉΓòÉ 14.34. GOSUB - Execute a subroutine in a batch file ΓòÉΓòÉΓòÉ
  6663.  
  6664.  Purpose:    Execute a subroutine in the current batch file. 
  6665.  
  6666.  Format:     GOSUB label 
  6667.  
  6668.              label :  The batch file label at the beginning of the subroutine. 
  6669.  
  6670.  See also:  CALL, GOTO and RETURN. 
  6671.  
  6672.  Usage 
  6673.  
  6674.  GOSUB can only be used in batch files. 
  6675.  
  6676.  4OS2 allows subroutines in batch files.  A subroutine must start with a label 
  6677.  (a colon [:] followed by a one-word label name) which appears on a line by 
  6678.  itself.  Case differences are ignored when matching labels.  The subroutine 
  6679.  must end with a RETURN statement. 
  6680.  
  6681.  The subroutine is invoked with a GOSUB command from another part of the batch 
  6682.  file.  After the RETURN, processing will continue with the command following 
  6683.  the GOSUB command.  For example, the following batch file fragment calls a 
  6684.  subroutine which displays the directory and returns: 
  6685.  
  6686.           echo Calling a subroutine
  6687.           gosub subr1
  6688.           echo Returned from the subroutine
  6689.           quit
  6690.           :subr1
  6691.           dir /a/w
  6692.           return
  6693.  
  6694.  If the label doesn't exist, the batch file is terminated with the error 
  6695.  message "Label not found." 
  6696.  
  6697.  GOSUB saves the IFF state, so IFF statements inside a subroutine won't 
  6698.  interfere with IFF statements in the part of the batch file from which the 
  6699.  subroutine was called. 
  6700.  
  6701.  Subroutines can be nested. 
  6702.  
  6703.  
  6704. ΓòÉΓòÉΓòÉ 14.35. GOTO - Branch within a batch file ΓòÉΓòÉΓòÉ
  6705.  
  6706.  Purpose:    Branch to a specified line inside the current batch file. 
  6707.  
  6708.  Format:     GOTO [/I] label 
  6709.  
  6710.              label :  The batch file label to branch to. 
  6711.  
  6712.              /I(FF and DO continue) 
  6713.  
  6714.  See also:  GOSUB. 
  6715.  
  6716.  Usage 
  6717.  
  6718.  GOTO can only be used in batch files. 
  6719.  
  6720.  After a GOTO command in a batch file, the next line to be executed will be the 
  6721.  one immediately after the label.  The label must begin with a colon [:] and 
  6722.  appear on a line by itself. The colon is required on the line where the label 
  6723.  is defined, but is not required in the GOTO command itself.  Case differences 
  6724.  are ignored when matching labels. 
  6725.  
  6726.  This batch file fragment checks for the existence of the file CONFIG.SYS.  If 
  6727.  the file exists, the batch file jumps to C_EXISTS and copies all the files 
  6728.  from the current directory to the root directory on A:.  Otherwise, it prints 
  6729.  an error message and exits. 
  6730.  
  6731.           if exist config.sys goto C_EXISTS
  6732.           echo CONFIG.SYS doesn't exist - exiting.
  6733.           quit
  6734.           :C_EXISTS
  6735.           copy *.* a:\
  6736.  
  6737.  If the label doesn't exist, the batch file is terminated with the error 
  6738.  message "Label not found." 
  6739.  
  6740.  To avoid errors in the processing of nested statements and loops, GOTO cancels 
  6741.  all active IFF statements and DO / ENDDO loops unless you use /I.  This means 
  6742.  that a normal GOTO (without /I) may not branch to any label that is between an 
  6743.  IFF and the corresponding ENDIFF or between a DO and the corresponding ENDDO. 
  6744.  
  6745.  Options 
  6746.  
  6747.     /I:     (IFF and DO continue) Prevents GOTO from canceling IFF statements 
  6748.             and DO loops.  Use this option only if you are absolutely certain 
  6749.             that your GOTO command is branching entirely within any current IFF 
  6750.             statement and any active DO / ENDDO block.  Using /I under any 
  6751.             other conditions will cause an error later in your batch file. 
  6752.  
  6753.             You cannot branch into another IFF statement, another DO loop, or a 
  6754.             different IFF or DO nesting level, whether you use the /I option or 
  6755.             not.  If you do, you will eventually receive an "unknown command" 
  6756.             error (or execution of the UNKNOWN_CMD alias) on a subsequent 
  6757.             ENDDO, ELSE, ELSEIFF, or ENDIFF statement. 
  6758.  
  6759.  
  6760. ΓòÉΓòÉΓòÉ 14.36. HELP - Display help ΓòÉΓòÉΓòÉ
  6761.  
  6762.  Purpose:    Display help for internal commands, and optionally for external 
  6763.              commands. 
  6764.  
  6765.  Format:     HELP [topic ] 
  6766.  
  6767.              topic :  A help topic, internal command, or external command. 
  6768.  
  6769.  Usage 
  6770.  
  6771.  Online help is available for 4OS2.  The 4OS2 help system uses the OS/2 help 
  6772.  facility. 
  6773.  
  6774.  If you type the command HELP by itself (or press F1 when the command line is 
  6775.  empty), the table of contents is displayed.  If you type HELP plus a topic 
  6776.  name, that topic is displayed.  For example, 
  6777.  
  6778.           help copy
  6779.  
  6780.  displays information about the COPY command and its options. 
  6781.  
  6782.  
  6783. ΓòÉΓòÉΓòÉ 14.37. HISTORY - Manage the history list ΓòÉΓòÉΓòÉ
  6784.  
  6785.  Purpose:    Display, add to, clear, or read the history list. 
  6786.  
  6787.  Format:     HISTORY [/A command /F /P /R filename ] 
  6788.  
  6789.              /A(dd)                          /P(ause) 
  6790.              /F(ree)                         /R(ead) 
  6791.  
  6792.  See also:  LOG. 
  6793.  
  6794.  Usage 
  6795.  
  6796.  4OS2 keeps a list of the commands you have entered on the command line.  See 
  6797.  Command History and Recall for additional details. 
  6798.  
  6799.  The HISTORY command lets you view and manipulate the command history list 
  6800.  directly.  If no parameters are entered, HISTORY will display the current 
  6801.  command history list: 
  6802.  
  6803.           [c:\] history
  6804.  
  6805.  With the options explained below, you can clear the list, add new commands to 
  6806.  the list without executing them, save the list in a file, or read a new list 
  6807.  from a file. 
  6808.  
  6809.  The number of commands saved in the history list depends on the length of each 
  6810.  command line.  The history list size can be specified at startup from 256 to 
  6811.  8192 characters (see the History directive).  The default size is 1024 
  6812.  characters. 
  6813.  
  6814.  Your history list can be stored either locally (a separate history list for 
  6815.  each copy of 4OS2) or globally (all copies of 4OS2 share the same list).  For 
  6816.  full details see the discussion of local and global history lists under 
  6817.  Command History and Recall. 
  6818.  
  6819.  You can use the HISTORY command as an aid in writing batch files by 
  6820.  redirecting the HISTORY output to a file and then editing the file 
  6821.  appropriately.  However, it is easier to use the LOG /H command for this 
  6822.  purpose. 
  6823.  
  6824.  You can disable the history list or specify a minimum command-line length to 
  6825.  save with the HistMin directive in the .INI file. 
  6826.  
  6827.  Options 
  6828.  
  6829.     /A:     (Add) Add a command to the history list.  This performs the same 
  6830.             function as the Ctrl-K key at the command line (see Command History 
  6831.             and Recall). 
  6832.  
  6833.     /F:     (Free) Erase all entries in the command history list. 
  6834.  
  6835.     /P:     (Prompt) Wait for a key after displaying each page of the list. 
  6836.             Your options at the prompt are explained in detail under Page and 
  6837.             File Prompts. 
  6838.  
  6839.     /R:     (Read) Read the command history from the specified file and append 
  6840.             it to the history list currently held in memory.  Each line in the 
  6841.             file must fit within the command-line length limit). 
  6842.  
  6843.             You can save the history list by redirecting the output of HISTORY 
  6844.             to a file.  This example saves the command history to a file called 
  6845.             HISTFILE and reads it back again immediately.  If you leave out the 
  6846.             HISTORY /F command on the second line, the contents of the file 
  6847.             will be appended to the current history list instead of replacing 
  6848.             it: 
  6849.  
  6850.                                 [c:\] history > histfile
  6851.                                 [c:\] history /f
  6852.                                 [c:\] history /r histfile
  6853.  
  6854.             If you need to save your history at the end of each day's work, you 
  6855.             might use commands like this in your AUTOEXEC.BAT or other startup 
  6856.             file: 
  6857.  
  6858.                                 if exist c:\histfile history /r c:\histfile
  6859.                                 alias shut*down `history > c:\histfile`
  6860.  
  6861.             This restores the previous history list if it exists, then defines 
  6862.             an alias which will save the history before shutting off the 
  6863.             system. 
  6864.  
  6865.             If you are creating a HISTORY /R file by hand, and need to create 
  6866.             an entry that spans multiple lines in the file, you can do so by 
  6867.             terminating each line, except the last, with an escape character. 
  6868.             However, you cannot use this method to exceed the command-line 
  6869.             length limit. 
  6870.  
  6871.  
  6872. ΓòÉΓòÉΓòÉ 14.38. IF - Execute a command if a condition is true ΓòÉΓòÉΓòÉ
  6873.  
  6874.  Purpose:    Execute a command if a condition or set of conditions is true. 
  6875.  
  6876.  Format:     IF [NOT] condition [.AND. | .OR. | .XOR. [NOT] condition ...] 
  6877.              command 
  6878.  
  6879.              condition :  A test to determine if the command should be 
  6880.              executed. 
  6881.              command :  The command to execute if the condition is true. 
  6882.  
  6883.  See also:  IFF. 
  6884.  
  6885.  Usage 
  6886.  
  6887.  IF is normally used only in aliases and batch files.  It is always followed by 
  6888.  one or more conditions and then a command. First, the conditions are 
  6889.  evaluated.  If they are true, the command is executed.  Otherwise, the command 
  6890.  is ignored. If you add a NOT before a condition, the command is executed only 
  6891.  when the condition is false. 
  6892.  
  6893.  You can link conditions with .AND., .OR., or .XOR., and you can nest IF 
  6894.  statements.  The conditions can test strings, numbers, the existence of a file 
  6895.  or subdirectory, the exit code returned by the preceding external command, and 
  6896.  the existence of alias names and internal commands. 
  6897.  
  6898.  The command can be an alias, an internal command, an external command, or a 
  6899.  batch file.  The entire IF statement, including all conditions and the 
  6900.  command, must fit on one line. 
  6901.  
  6902.  You can use command grouping to execute multiple commands if the condition is 
  6903.  true.  For example, the following command tests if any .TXT files exist.  If 
  6904.  they do, they are copied to drive A: and their extensions are changed to .TXO 
  6905.  : 
  6906.  
  6907.           if exist *.txt (copy *.txt a: & ren *.txt *.txo)
  6908.  
  6909.  (Note that the IFF command provides a more structured method of executing 
  6910.  multiple commands if a condition or set of conditions is true.) 
  6911.  
  6912.  Conditions 
  6913.  
  6914.  The following conditional tests are available in both the IF and IFF commands. 
  6915.  They fit into two categories:  string and numeric tests, and status tests. 
  6916.  The tests can use environment variables, internal variables and variable 
  6917.  functions, file names, literal text, and numeric values as their arguments. 
  6918.  
  6919.  Spaces are required on either side of the test condition in all cases, except 
  6920.  == which will work with or without spaces around it. 
  6921.  
  6922.  String and Numeric Tests 
  6923.  
  6924.  Six test conditions can be used to test character strings.  The same 
  6925.  conditions are available for both numeric and normal text strings (see below 
  6926.  for details).  In each case you enter the test as: 
  6927.  
  6928.           string1 operator string2
  6929.  
  6930.  The operator defines the type of test (equal, greater than or equal, and so 
  6931.  on).  The operators are: 
  6932.  
  6933.         EQ or ==    string1 equal to string2 
  6934.         NE or !=    string1 not equal to string2 
  6935.         LT          string1 less than string2 
  6936.         LE          string1 less than or equal to string2 
  6937.         GE          string1 greater than or equal to string2 
  6938.         GT          string1 greater than string2 
  6939.  
  6940.  Status Tests 
  6941.  
  6942.  These conditions test the system or command processor status.  You can use 
  6943.  internal variables and variable functions to test many other parts of the 
  6944.  system status. 
  6945.  
  6946.     ERRORLEVEL [operator] n
  6947.         This test retrieves the exit code of the preceding external program. 
  6948.         By convention, programs return an exit code of 0 when they are 
  6949.         successful and a number between 1 and 255 to indicate an error.  The 
  6950.         condition can be any of the operators listed above (EQ, !=, GT, etc.). 
  6951.         If no operator is specified, the default is GE.  The comparison is done 
  6952.         numerically. 
  6953.  
  6954.         Not all programs return an explicit exit code.  For programs which do 
  6955.         not, the behavior of ERRORLEVEL is undefined. 
  6956.  
  6957.     EXIST filename
  6958.         If the file exists, the condition is true.  You can use wildcards in 
  6959.         the filename, in which case the condition is true if any file matching 
  6960.         the wildcard name exists. 
  6961.  
  6962.     ISALIAS aliasname
  6963.         If the name is defined as an alias, the condition is true. 
  6964.  
  6965.     ISDIR path
  6966.         If the subdirectory exists, the condition is true. 
  6967.  
  6968.     ISINTERNAL command
  6969.         If the specified command is an active internal command, the condition 
  6970.         is true.  Commands can be activated and deactivated with the SETDOS /I 
  6971.         command. 
  6972.  
  6973.  Combining Tests 
  6974.  
  6975.  You can negate the result of any test with NOT, and combine tests of any type 
  6976.  with .AND., .OR., and .XOR.  Test conditions are always scanned from left to 
  6977.  right -- there is no implied order of precedence, as there is in some 
  6978.  programming languages. 
  6979.  
  6980.  When two tests are combined with .AND., the result is true if both individual 
  6981.  tests are true.  When two tests are combined with .OR., the result is true if 
  6982.  either (or both) individual tests are true.  When two tests are combined with 
  6983.  .XOR., the result is true only if one of the tests is true and the other is 
  6984.  false. 
  6985.  
  6986.  This example runs a program called HIGHRES if either an EGA or VGA video 
  6987.  adapter is in use: 
  6988.  
  6989.           if "%_video"=="EGA" .or. "%_video"==vga highres
  6990.  
  6991.  Using the IF Tests 
  6992.  
  6993.  When IF compares two character strings, it will use either a numeric 
  6994.  comparison or a string comparison.  A numeric comparison treats the strings as 
  6995.  numeric values and tests them arithmetically.  A string comparison treats the 
  6996.  strings as text. 
  6997.  
  6998.  The difference between numeric and string comparisons is best explained by 
  6999.  looking at the way two values are tested.  For example, consider comparing the 
  7000.  values 2 and 19.  Numerically, 2 is smaller, but as a string it is "larger" 
  7001.  because its first digit is larger than the first digit of 19.  So the first of 
  7002.  these condition s will be true, and the second will be false: 
  7003.  
  7004.           if 2 lt 19 ...
  7005.           if "2" lt "19" ...
  7006.  
  7007.  IF determines which kind of test to do by examining the first character of 
  7008.  each string.  If both strings begin with a numeric character (a digit, sign, 
  7009.  or decimal point), a numeric comparison is used.  If either value does not 
  7010.  begin with a numeric character, a string comparison is used.  To force a 
  7011.  string comparison when both values are or may be numeric, use double quotes 
  7012.  around the values you are testing, as shown above.  Because the double quote 
  7013.  is not a numeric character, it forces IF to do a string comparison. 
  7014.  
  7015.  Case differences are ignored in string comparisons.  If two strings begin with 
  7016.  the same text but one is shorter, the shorter string is considered to be "less 
  7017.  than" the longer one.  For example, "a" is less than "abc", and "hello_there" 
  7018.  is greater than "hello". 
  7019.  
  7020.  When you compare text strings, you should always enclose the arguments in 
  7021.  double quotes in order to avoid syntax errors which may occur if one of the 
  7022.  argument values is empty. 
  7023.  
  7024.  Numeric comparisons work with both integer and decimal values.  The values to 
  7025.  be compared must contain only numeric digits, decimal points, and an optional 
  7026.  sign (+ or -).  The number to the left of the decimal point may not exceed 
  7027.  2,147,483,648 (the maximum possible 32-bit positive integer).  The number of 
  7028.  digits to the right of the decimal point is limited only by the length of the 
  7029.  command line. 
  7030.  
  7031.  Internal variables and variable functions are very powerful when combined with 
  7032.  string and numeric comparisons.  They allow you to test the state of your 
  7033.  system, the characteristics of a file, date and time information, or the 
  7034.  result of a calculation.  You may want to review the variables and variable 
  7035.  functions when determining the best way to set up an IF test. 
  7036.  
  7037.  This first example is a batch file fragment which runs a program called 
  7038.  MONOPROG if a monochrome monitor is attached to the system: 
  7039.  
  7040.           if "%_monitor" == "mono" monoprog
  7041.  
  7042.  The second batch file fragment tests for a string value: 
  7043.  
  7044.           input "Enter your selection : " %%cmd
  7045.           if "%cmd" == "WP" goto wordproc
  7046.           if "%cmd" NE "GRAPHICS" goto badentry
  7047.  
  7048.  This example calls GO.BTM if the first two characters in the file MYFILE are 
  7049.  "GO" (enter this example on one line): 
  7050.  
  7051.           if "%@instr[0,2,%@line[myfile,0]]"=="GO"
  7052.           call go.btm
  7053.  
  7054.  This batch file fragment tests for the existence of A:\JAN.DOC before copying 
  7055.  it to drive C. 
  7056.  
  7057.           if exist a:\jan.doc copy a:\jan.doc c:\
  7058.  
  7059.  This example tests the exit code of the previous program and stops all batch 
  7060.  file processing if an error occurred: 
  7061.  
  7062.           if errorlevel==0 goto success
  7063.           echo "External Error -- Batch File Ends!"
  7064.           cancel
  7065.  
  7066.  
  7067. ΓòÉΓòÉΓòÉ 14.39. IFF - IF / THEN / ELSE conditional command execution ΓòÉΓòÉΓòÉ
  7068.  
  7069.  Purpose:    Perform IF / THEN / ELSE conditional execution of commands. 
  7070.  
  7071.  Format:     IFF [NOT] condition [.AND. | .OR. | .XOR. [NOT] condition ...] 
  7072.              THEN & commands 
  7073.              [ELSEIFF condition  THEN & commands ] ... 
  7074.              [ELSE & commands ] 
  7075.              & ENDIFF 
  7076.  
  7077.              condition :  A test to determine if the command(s) should be 
  7078.              executed. 
  7079.              commands :  One or more commands to execute if the condition(s) is 
  7080.              true.  If you use multiple commands, they must be separated by 
  7081.              command separators or be placed on separate lines of a batch file. 
  7082.  
  7083.  See also:  IF. 
  7084.  
  7085.  Usage 
  7086.  
  7087.  IFF is similar to the IF command, except that it can perform one set of 
  7088.  commands when a condition or set of conditions is true and different commands 
  7089.  when the conditions are false. 
  7090.  
  7091.  IFF can execute multiple commands when the conditions are true or false; IF 
  7092.  normally executes only one command.  IFF imposes no limit on the number of 
  7093.  commands and is generally a "cleaner" and more structured command than IF. 
  7094.  
  7095.  IFF is always followed by one or more conditions.  If they are true, the 
  7096.  commands that follow the word THEN are executed. Additional conditions can be 
  7097.  tested with ELSEIFF.  If none of these conditions are true, the commands that 
  7098.  follow the word ELSE are executed.  In both cases, after the selected commands 
  7099.  are executed, processing continues after the word ENDIFF. 
  7100.  
  7101.  If you add a NOT before the condition, the THEN commands are executed only 
  7102.  when the condition is false and the ELSE commands are executed only when the 
  7103.  condition is true. 
  7104.  
  7105.  The commands may be separated by command separators, or may be on separate 
  7106.  lines of a batch file.  You should include a command separator or a line break 
  7107.  after a THEN, before an ELSEIFF, and before and after an ELSE. 
  7108.  
  7109.  You can link conditions with .AND., .OR., or .XOR., and you can nest IFF 
  7110.  statements up to 15 levels deep.  The conditions can test strings or numbers, 
  7111.  the existence of a file or subdirectory, the errorlevel returned from the 
  7112.  preceding external command, and the existence of alias names and internal 
  7113.  commands. 
  7114.  
  7115.  See the IF command for a list of the possible conditions. 
  7116.  
  7117.  The commands can include any internal command, alias, external command, or 
  7118.  batch file. 
  7119.  
  7120.  The following batch file fragment tests the monitor type (monochrome or 
  7121.  color), and sets the appropriate colors and prompt (enter the "prompt" lines 
  7122.  on one line of the batch file): 
  7123.  
  7124.           iff "%_monitor" == "color" then
  7125.              color bright white on blue & cls
  7126.              prompt=$e[s$e[1;1f$e[41;1;37m$e[K  Path: $p$e[u$e[44;37m$n$g
  7127.           else
  7128.              prompt=$e[s$e[1;1f$e[0;7m$e[K  Path: $p$e[u$e[0m$n$g
  7129.           endiff
  7130.  
  7131.  The alias in this second example checks to see if the argument is a 
  7132.  subdirectory.  If so, the alias deletes the subdirectory's files and removes 
  7133.  it (enter this on one line): 
  7134.  
  7135.           [c:\] alias prune `iff isdir %1 then & del /sxz %1
  7136.                 & else & echo Not a directory! & endiff`
  7137.  
  7138.  Be sure to read the cautionary notes about GOTO and IFF under the GOTO command 
  7139.  before using a GOTO inside an IFF statement. 
  7140.  
  7141.  
  7142. ΓòÉΓòÉΓòÉ 14.40. INKEY - Get a character from the keyboard ΓòÉΓòÉΓòÉ
  7143.  
  7144.  Purpose:    Get a single keystroke from the user and store it in an 
  7145.              environment variable. 
  7146.  
  7147.  Format:     INKEY [/C /K"keys" /P /Wn] [prompt ] %%varname 
  7148.  
  7149.              prompt :  Optional text that is displayed as a prompt. 
  7150.              varname :  The variable that will hold the user's keystroke. 
  7151.  
  7152.              /C(lear buffer)                 /P(assword) 
  7153.              /K (valid keystrokes)           /W(ait) 
  7154.  
  7155.  See also:  INPUT. 
  7156.  
  7157.  Usage 
  7158.  
  7159.  INKEY optionally displays a prompt.  Then it waits for a specified time or 
  7160.  indefinitely for a keystroke, and places the keystroke into an environment 
  7161.  variable.  It is normally used in batch files and aliases to get a menu choice 
  7162.  or other single-key input.  Along with the INPUT command, INKEY allows great 
  7163.  flexibility in reading input from within a batch file or alias. 
  7164.  
  7165.  If prompt text is included in an INKEY command, it is displayed while INKEY 
  7166.  waits for input. 
  7167.  
  7168.  The following batch file fragment prompts for a character and stores it in the 
  7169.  variable NUM : 
  7170.  
  7171.           inkey Enter a number from 1 to 9:  %%num
  7172.  
  7173.  INKEY reads standard input for the keystroke, so it will accept keystrokes 
  7174.  from a redirected file.  You can supply a list of valid keystrokes with the /K 
  7175.  option. 
  7176.  
  7177.  Standard keystrokes with ASCII values between 1 and 255 are stored directly in 
  7178.  the environment variable.  Extended keystrokes (for example, function keys and 
  7179.  cursor keys) are stored as a string in decimal format, with a leading @ (for 
  7180.  example, the F1 key is @59).  The Enter key is stored as an extended 
  7181.  keystroke, with the code @28.  See see the Reference Tables for a list of the 
  7182.  ASCII and extended key codes. 
  7183.  
  7184.  If you press Ctrl-C or Ctrl-Break while INKEY is waiting for a key, execution 
  7185.  of an alias will be terminated, and execution of a batch file will be 
  7186.  suspended while you are asked whether to cancel the batch jobIn a batch file 
  7187.  you can handle Ctrl-C and Ctrl-Break yourself with the ON BREAK command. 
  7188.  
  7189.  Options 
  7190.  
  7191.     /C:     (Clear buffer) Clears the keyboard buffer before INKEY accepts 
  7192.             keystrokes.  If you use this option, INKEY will ignore any 
  7193.             keystrokes which you type, either accidentally or intentionally, 
  7194.             before INKEY is ready to accept input. 
  7195.  
  7196.     /K["keys"]:Specify the permissible keystrokes.  The list of valid 
  7197.             keystrokes should be enclosed in double quotes.  For alphabetic 
  7198.             keys the validity test is not case sensitive.  You can specify 
  7199.             extended keys by enclosing their names in square brackets (within 
  7200.             the quotes), for example: 
  7201.  
  7202.                                 inkey /k"ab[Alt-F10]" Enter A, B, Alt-F10 %%var
  7203.  
  7204.             See Keys and Key Names for a complete listing of the key names you 
  7205.             can use within the square brackets, and a description of the key 
  7206.             name format. 
  7207.  
  7208.             If an invalid keystroke is entered, 4OS2 will echo the keystroke if 
  7209.             possible, beep, move the cursor back one character, and wait for 
  7210.             another keystroke. 
  7211.  
  7212.     /P:     (Password) Prevents INKEY from echoing the character. 
  7213.  
  7214.     /W:     (Wait) Timeout period, in seconds, to wait for a response. If no 
  7215.             keystroke is entered by the end of the timeout period, INKEY 
  7216.             returns with the variable unchanged. You can specify /W0 to return 
  7217.             immediately if there are no keys waiting in the keyboard buffer. 
  7218.  
  7219.             For example, the following batch file fragment waits up to 10 
  7220.             seconds for a character, then tests to see if a "Y" was entered: 
  7221.  
  7222.                                 set net=N
  7223.                                 inkey /K"YN" /w10 Load network (Y/N)?  %%net
  7224.                                 iff "%net" == "Y" then
  7225.                                 rem Commands to load the network go here
  7226.                                 endiff
  7227.  
  7228.  
  7229. ΓòÉΓòÉΓòÉ 14.41. INPUT - Get a string from the keyboard ΓòÉΓòÉΓòÉ
  7230.  
  7231.  Purpose:    Get a string from the keyboard and save it in an environment 
  7232.              variable. 
  7233.  
  7234.  Format:     INPUT [/C /E /Ln /P /Wn] [prompt ] %%varname 
  7235.  
  7236.              prompt :  Optional text that is displayed as a prompt. 
  7237.              varname :  The variable that will hold the user's input. 
  7238.  
  7239.              /C(lear buffer)                 /P(assword) 
  7240.              /E(dit)                         /W(ait) 
  7241.              /L(ength) 
  7242.  
  7243.  See also:  INKEY. 
  7244.  
  7245.  Usage 
  7246.  
  7247.  INPUT optionally displays a prompt.  Then it waits for a specified time or 
  7248.  indefinitely for your entry.  It places any characters you type into an 
  7249.  environment variable.  INPUT is normally used in batch files and aliases to 
  7250.  get multi-key input.  Along with the INKEY command, INPUT allows great 
  7251.  flexibility in reading user input from within a batch file or alias. 
  7252.  
  7253.  If prompt text is included in an INPUT command, it is displayed while INPUT 
  7254.  waits for input.  Standard command-line editing keys may be used to edit the 
  7255.  input string as it is entered.  If you use the /P password option, INPUT will 
  7256.  echo asterisks instead of the keys you type. 
  7257.  
  7258.  All characters entered up to, but not including, the carriage return are 
  7259.  stored in the variable. 
  7260.  
  7261.  The following batch file fragment prompts for a string and stores it in the 
  7262.  variable FNAME: 
  7263.  
  7264.           input Enter the file name:  %%fname
  7265.  
  7266.  INPUT reads standard input, so it will accept text from a re- directed file. 
  7267.  
  7268.  If you press Ctrl-C or Ctrl-Break while INPUT is waiting for input, execution 
  7269.  of an alias will be terminated, and execution of a batch file will be 
  7270.  suspended while you are asked whether to cancel the batch job.  In a batch 
  7271.  file you can handle Ctrl-C and Ctrl-Break yourself with the ON BREAK command. 
  7272.  
  7273.  Options 
  7274.  
  7275.     /C:     (Clear buffer) Clears the keyboard buffer before INPUT accepts 
  7276.             keystrokes.  If you use this option, INPUT will ignore any 
  7277.             keystrokes which you type, either accidentally or intentionally, 
  7278.             before INPUT is ready. 
  7279.  
  7280.     /E:     (Edit) Allows you to edit an existing value.  If there is no 
  7281.             existing value for varname, INPUT proceeds as if /E had not been 
  7282.             used, and allows you to enter a new value. 
  7283.  
  7284.     /Ln:    (Length) Sets the maximum number of characters which INPUT will 
  7285.             accept to "n".  If you attempt to enter more than this number of 
  7286.             characters, INPUT will beep and prevent further input (you will 
  7287.             still be able to edit the characters typed before the limit was 
  7288.             reached). 
  7289.  
  7290.     /P:     (Password) Tells INPUT to echo asterisks, instead of the characters 
  7291.             you type. 
  7292.  
  7293.     /W:     (Wait) Timeout period, in seconds, to wait for a response. If no 
  7294.             keystroke is entered by the end of the timeout period, INPUT 
  7295.             returns with the variable unchanged. If you enter a key before the 
  7296.             timeout period, INPUT will wait indefinitely for the remainder of 
  7297.             the line.  You can specify /W0 to return immediately if there are 
  7298.             no keys waiting in the keyboard buffer. 
  7299.  
  7300.  
  7301. ΓòÉΓòÉΓòÉ 14.42. KEYBD - Set the keyboard toggles ΓòÉΓòÉΓòÉ
  7302.  
  7303.  Purpose:    Set the state of the keyboard toggles:  Caps Lock, Num Lock, and 
  7304.              Scroll Lock. 
  7305.  
  7306.  Format:     KEYBD [/Cn /Nn /Sn] 
  7307.  
  7308.              n :  0 to turn off the toggle, or 1 to turn on the toggle. 
  7309.  
  7310.              /C(aps lock)                    /S(croll lock) 
  7311.              /N(um lock) 
  7312.  
  7313.  Usage 
  7314.  
  7315.  Most keyboards have 3 toggle keys, the Caps Lock, Num Lock, and Scroll Lock. 
  7316.  The toggle key status is usually displayed by three lights at the top right 
  7317.  corner of the keyboard. 
  7318.  
  7319.  This command lets you turn any toggle key on or off.  It is most useful in 
  7320.  batch files and aliases if you want the keys set a particular way before 
  7321.  collecting input from the user. 
  7322.  
  7323.  For example, to turn off the Num Lock and Caps Lock keys, you can use this 
  7324.  command: 
  7325.  
  7326.           [c:\] keybd /c0 /n0
  7327.  
  7328.  If you use the KEYBD command with no switches, it will display the present 
  7329.  state of the toggle keys. 
  7330.  
  7331.  In OS/2, the toggle key state is different for each session. Changes made with 
  7332.  KEYBD will affect the session in which the command is executed, but will not 
  7333.  affect other sessions. 
  7334.  
  7335.  Options 
  7336.  
  7337.     /C:     (Caps lock) Turn the Caps Lock key on or off. 
  7338.  
  7339.     /N:     (Num lock) Turn the Num Lock key on or off. 
  7340.  
  7341.     /S:     (Scroll lock) Turn the Scroll Lock key on or off. 
  7342.  
  7343.  
  7344. ΓòÉΓòÉΓòÉ 14.43. KEYS - Enable or disable the history list ΓòÉΓòÉΓòÉ
  7345.  
  7346.  Purpose:    Enable, disable, or display the history list. 
  7347.  
  7348.  Format:     KEYS [ON | OFF | LIST] 
  7349.  
  7350.  See also:  HISTORY. 
  7351.  
  7352.  Usage 
  7353.  
  7354.  This command is provided for compatibility with KEYS command in CMD.EXE, which 
  7355.  controls the history list in OS/2. The same functions are available by setting 
  7356.  the HistMin directive in the .INI file, and by using the HISTORY command. 
  7357.  
  7358.  The history list collects the commands you type for later recall, editing, and 
  7359.  viewing.  You can view the contents of the list through the history list 
  7360.  window or by typing any of the following commands: 
  7361.  
  7362.           [c:\] history
  7363.           [c:\] history /p
  7364.           [c:\] keys list
  7365.  
  7366.  The first command displays the entire history list.  The second displays the 
  7367.  entire list and pauses at the end of each full screen. The third command 
  7368.  produces the same output as the first, except that each line is numbered. 
  7369.  
  7370.  You can disable the collection and storage of commands in the history list by 
  7371.  typing: 
  7372.  
  7373.           [c:\] keys off
  7374.  
  7375.  You can turn the history back on with the command: 
  7376.  
  7377.           [c:\] keys on
  7378.  
  7379.  If you issue the KEYS command without any parameters, 4OS2 will show you the 
  7380.  current status of the history list. 
  7381.  
  7382.  KEYS also affects the way 4OS2 reads input from the keyboard.  KEYS OFF will 
  7383.  force 4OS2 into line input mode; KEYS ON will return input to the usual 
  7384.  character by character method.  See the LineInput directive, or the /L option 
  7385.  of the SETDOS command, for details on line input mode. 
  7386.  
  7387.  
  7388. ΓòÉΓòÉΓòÉ 14.44. LIST - Display a file ΓòÉΓòÉΓòÉ
  7389.  
  7390.  Purpose:    Display a file, with forward and backward paging and scrolling. 
  7391.  
  7392.  Format:     LIST [/H /S /W /X] file... 
  7393.  
  7394.              file :  A file or list of files to display. 
  7395.  
  7396.              /H(igh bit off)                 /W(rap) 
  7397.              /S(tandard input)               /X (heX display mode) 
  7398.  
  7399.  See also:  TYPE. 
  7400.  
  7401.  File Selection 
  7402.  
  7403.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  7404.  
  7405.  Usage 
  7406.  
  7407.  LIST provides a much faster and more flexible way to view a file than TYPE, 
  7408.  without the overhead of loading and using a text editor. 
  7409.  
  7410.  LIST is most often used for displaying ASCII text files.  Most other files 
  7411.  contain non-alphabetic characters and may be unreadable, except in hex mode. 
  7412.  
  7413.  For example, to display a file called MEMO.DOC : 
  7414.  
  7415.           [c:\] list memo.doc
  7416.  
  7417.  LIST uses the cursor pad to scroll through the file.  The following keys have 
  7418.  special meanings: 
  7419.  
  7420.         Home        Display the first page of the file. 
  7421.         End         Display the last page of the file. 
  7422.         Esc         Exit the current file. 
  7423.         Ctrl-C      Quit LIST. 
  7424.                    Scroll up one line. 
  7425.                    Scroll down one line. 
  7426.                    Scroll left 8 columns. 
  7427.                    Scroll right 8 columns. 
  7428.         Ctrl       Scroll left 40 columns. 
  7429.         Ctrl       Scroll right 40 columns. 
  7430.         F1          Display online help 
  7431.         F           Prompt and search for a string. 
  7432.         G           Go to a specific line. 
  7433.         H           Toggle the "strip high bit" (/H) option. 
  7434.         I           Display information on the current file (the full name, 
  7435.                     size, date, and time). 
  7436.         N           Find next matching string. 
  7437.         P           Print the entire file. 
  7438.         W           Toggle the "line wrap" (/W) option. 
  7439.         X           Toggle the hex-mode display (/X) option. 
  7440.  
  7441.  Text searches performed with F and N are not case sensitive.  However, if the 
  7442.  display is currently in hexadecimal mode and you press F, you will be prompted 
  7443.  for whether you want to search in hexadecimal as well.  If you answer Y, you 
  7444.  should then enter the search string as a sequence of 2-digit hexadecimal 
  7445.  numbers separated by spaces, for example 41 63 65 (these are the ASCII values 
  7446.  for the string "Ace"; see ASCII for a complete list of ASCII codes). 
  7447.  Hexadecimal searches are case sensitive, and search for exactly the string you 
  7448.  enter. 
  7449.  
  7450.  LIST saves the search string used by F and N, so you can LIST multiple files 
  7451.  and search for the same string simply by pressing N in each file, or repeat 
  7452.  your search the next time you use LIST. 
  7453.  
  7454.  LIST normally allows long lines in the file to extend past the right edge of 
  7455.  the screen.  You can use the horizontal scrolling keys (see above) to view 
  7456.  text that extends beyond the screen width.  If you use the W command or /W 
  7457.  switch to wrap the display, each line is wrapped when it reaches the right 
  7458.  edge of the screen, and the horizontal scrolling keys are disabled. 
  7459.  
  7460.  If you print the file which LIST is displaying, the print format will match 
  7461.  the display format.  If you have switched to hexadecimal or wrapped mode, that 
  7462.  mode will be used for the printed output as well.  If you print in wrapped 
  7463.  mode, long lines will be wrapped at the width of the display.  If you print in 
  7464.  normal display mode without line wrap, long lines will be wrapped or truncated 
  7465.  by the printer, not by LIST. 
  7466.  
  7467.  Printed output normally goes to device LPT1.  If you wish to send the printed 
  7468.  output to another device, use the Printer directive in the .INI file. 
  7469.  
  7470.  Most of the LIST keystrokes can be reassigned with key mapping directives in 
  7471.  the .INI file . 
  7472.  
  7473.  You can set the colors used by LIST with the ListColors and ListStatBarColors 
  7474.  directives in the .INI file.  If ListColors is not used, the LIST display will 
  7475.  use the current default colors.  If ListStatBarColors is not used, the status 
  7476.  bar will use the reverse of the LIST display colors. 
  7477.  
  7478.  Options 
  7479.  
  7480.     /H:     (High bit off) Strip the high bit from each character before 
  7481.             displaying.  This is useful when displaying files created by some 
  7482.             word processors that turn on the high bit for formatting purposes. 
  7483.             You can toggle this option on and off from within LIST with the H 
  7484.             key. 
  7485.  
  7486.     /S:     (Standard input) Read from standard input rather than a file.  This 
  7487.             allows you to redirect command output and view it with LIST.  For 
  7488.             example, to use LIST to display the output of DIR: 
  7489.  
  7490.                                 [c:\] dir | list /s
  7491.  
  7492.     /W:     (Wrap) Wrap the text at the right edge of the screen.  This option 
  7493.             is useful when displaying files that don't have a carriage return 
  7494.             at the end of each line.  The horizontal scrolling keys do not work 
  7495.             when the display is wrapped.  You can toggle this option on and off 
  7496.             from within LIST with the W key. 
  7497.  
  7498.     /X      (hex mode):  Display the file in hexadecimal (hex) mode. This 
  7499.             option is useful when displaying executable files and other files 
  7500.             that contain non-text characters.  Each byte of the file is shown 
  7501.             as a pair of hex characters.  The corresponding text is displayed 
  7502.             to the right of each line of hexadecimal data.  You can toggle this 
  7503.             mode on and off from within LIST with the X key. 
  7504.  
  7505.  
  7506. ΓòÉΓòÉΓòÉ 14.45. LOADBTM - Switch a batch file's mode ΓòÉΓòÉΓòÉ
  7507.  
  7508.  Purpose:    Switch a batch file to or from BTM mode. 
  7509.  
  7510.  Format:     LOADBTM [ON | OFF] 
  7511.  
  7512.  Usage 
  7513.  
  7514.  4OS2 recognizes two kinds of batch files: .BAT or .CMD, and .BTM.  Batch files 
  7515.  executing in BTM mode run two to five times faster than in BAT or CMD mode. 
  7516.  Batch files automatically start in the mode indicated by their extension. 
  7517.  
  7518.  The LOADBTM command turns BTM mode on and off.  It can be used to switch modes 
  7519.  in either a .BAT / .CMD or .BTM file.  If you use LOADBTM with no argument, it 
  7520.  will display the current batch mode:  LOADBTM ON or LOADBTM OFF. 
  7521.  
  7522.  LOADBTM can only be used within a batch file.  It is most often used to switch 
  7523.  a .BAT file into BTM mode after memory-resident programs are loaded, or to 
  7524.  convert a .BAT or .CMD file to BTM mode without changing its extension. 
  7525.  
  7526.  Using LOADBTM to repeatedly switch modes within a batch file is not efficient. 
  7527.  In most cases the speed gained by running some parts of the file in BTM mode 
  7528.  will be more than offset by the speed lost through repeated loading of the 
  7529.  file each time BTM mode is invoked. 
  7530.  
  7531.  
  7532. ΓòÉΓòÉΓòÉ 14.46. LOG - Save a log of commands ΓòÉΓòÉΓòÉ
  7533.  
  7534.  Purpose:    Save a log of commands to a disk file. 
  7535.  
  7536.  Format:     LOG [/H /W file ] [ON | OFF | text ] 
  7537.  
  7538.              file :  The name of the file to hold the log. 
  7539.              text :  An optional message that will be added to the log. 
  7540.  
  7541.              /H(istory log)                  /W(rite to). 
  7542.  
  7543.  See also:  HISTORY. 
  7544.  
  7545.  Usage 
  7546.  
  7547.  LOG keeps a record of all internal and external commands you use. Each entry 
  7548.  includes the current system date and time, along with the actual command after 
  7549.  any alias or variable expansion.  You can use the log file as a record of your 
  7550.  daily activities. 
  7551.  
  7552.  LOG with the /H option keeps a similar record, but it does not record the date 
  7553.  and time for each command.  In addition, it records commands before aliases 
  7554.  and variables are expanded. 
  7555.  
  7556.  By default, LOG writes to the file 4OS2LOG in the root directory of the boot 
  7557.  drive.  The default file name for LOG /H is 4OS2HLOG. 
  7558.  
  7559.  Entering LOG or LOG /H with no parameters displays the log status (ON or OFF): 
  7560.  
  7561.           [c:\] log
  7562.           LOG is OFF
  7563.  
  7564.  To enable or disable logging, add the word "ON" or "OFF" after the LOG 
  7565.  command: 
  7566.  
  7567.           [c:\] log on
  7568.  
  7569.  or 
  7570.  
  7571.           [c:\] log /h on
  7572.  
  7573.  Entering LOG or LOG /H with text writes a message to the log file, even if 
  7574.  logging  is set OFF.  This allows you to enter headers in the log file: 
  7575.  
  7576.           [c:\] log "Started work on the database system"
  7577.  
  7578.  The LOG file format looks like this: 
  7579.  
  7580.           [mm-dd-yy  hh:mm:ss]  command
  7581.  
  7582.  The LOG /H output can be used as the basis for writing batch files. Start LOG 
  7583.  /H, then execute the commands that you want the batch file to execute.  When 
  7584.  you are finished, turn LOG /H off.  The resulting file can be turned into a 
  7585.  batch file that performs the same commands with little or no editing. 
  7586.  
  7587.  You can have both a regular log (with time and date stamping) and a history 
  7588.  log (without the time stamps) enabled simultaneously. 
  7589.  
  7590.  Options 
  7591.  
  7592.     /H:     (History log) This option turns on (or off) the history log, which 
  7593.             saves commands without the time and date stamp.  For example, to 
  7594.             turn on history logging and write to the file C:\LOG\HLOG: 
  7595.  
  7596.                                 [c:\]  log /h /w c:\log\hlog
  7597.  
  7598.     /W:     (Write) This switch specifies a different filename for the LOG or 
  7599.             LOG /H output.  It also automatically performs a LOG ON command. 
  7600.             For example, to turn logging on and write the log to C:\LOG\LOGFILE 
  7601.             : 
  7602.  
  7603.                                 [c:\] log /w c:\log\logfile
  7604.  
  7605.             Once you select a new file name with the LOG /W or LOG /H/W 
  7606.             command, LOG will use that file until you issue another LOG /W or 
  7607.             LOG /H/W command, or until you reboot your computer.  Turning LOG 
  7608.             or LOG /H off or on does not change the file name.  You can set the 
  7609.             default log file names when 4OS2 starts with the LogName and 
  7610.             HistLogName directives in the .INI file. 
  7611.  
  7612.  
  7613. ΓòÉΓòÉΓòÉ 14.47. MD - Create a subdirectory ΓòÉΓòÉΓòÉ
  7614.  
  7615.  Purpose:    Create a subdirectory. 
  7616.  
  7617.  Format:     MD [/S] pathname... 
  7618.                 or 
  7619.              MKDIR [/S] pathname... 
  7620.  
  7621.              pathname :  The name of one or more directories to create. 
  7622.  
  7623.              /S(ubdirectories) 
  7624.  
  7625.  See also:  RD. 
  7626.  
  7627.  Usage 
  7628.  
  7629.  MD and MKDIR are synonyms.  You can use either one. 
  7630.  
  7631.  MD creates a subdirectory anywhere in the directory tree.  To create a 
  7632.  subdirectory from the root, start the pathname with a backslash [\].  For 
  7633.  example, this command creates a subdirectory called MYDIR in the root 
  7634.  directory: 
  7635.  
  7636.           [c:\] md \mydir
  7637.  
  7638.  If no path is given, the new subdirectory is created in the current directory. 
  7639.  This example creates a subdirectory called DIRTWO in the current directory: 
  7640.  
  7641.           [c:\mydir] md dirtwo
  7642.  
  7643.  To create a directory from the parent of the current directory (that is, to 
  7644.  create a sibling of the current directory), start the pathname with two 
  7645.  periods and a backslash [..\]. 
  7646.  
  7647.  Option 
  7648.  
  7649.     /S:     (Subdirectories) MD creates one directory at a time unless you use 
  7650.             the /S option.  If you need to create the directory 
  7651.             C:\ONE\TWO\THREE and none of the named directories exist, you can 
  7652.             use /S to have MD create all of the necessary subdirectories for 
  7653.             you in a single command: 
  7654.  
  7655.                                 [c:\] md /s \one\two\three
  7656.  
  7657.  
  7658. ΓòÉΓòÉΓòÉ 14.48. MEMORY - Display memory statistics ΓòÉΓòÉΓòÉ
  7659.  
  7660.  Purpose:    Display the amount and status of system RAM. 
  7661.  
  7662.  Format:     MEMORY 
  7663.  
  7664.  Usage 
  7665.  
  7666.  MEMORY lists the total physical and resident RAM in your system, the largest 
  7667.  free block of RAM, the total size of your swap file, the total and free 
  7668.  environment and alias space, and the total history space.  (The first two RAM 
  7669.  size values are displayed by 4OS2/32, but not by 4OS2/16.) 
  7670.  
  7671.  
  7672. ΓòÉΓòÉΓòÉ 14.49. MOVE - Move files ΓòÉΓòÉΓòÉ
  7673.  
  7674.  Purpose:    Move files to a new directory and drive. 
  7675.  
  7676.  Format:     MOVE  [/C /D /F /H /N /P /Q /R /S /T /U] source...  destination 
  7677.  
  7678.              source :  A file or list of files to move. 
  7679.              destination :  The new location for the files. 
  7680.  
  7681.              /C(hanged)                      /Q(uiet) 
  7682.              /D(irectory)                    /R(eplace) 
  7683.              /F(orce delete)                 /S(ubdirectory tree) 
  7684.              /H(idden and system)            /T(otal) 
  7685.              /N(othing)                      /U(pdate) 
  7686.              /P(rompt) 
  7687.  
  7688.  See also:  COPY and RENAME. 
  7689.  
  7690.  File Selection 
  7691.  
  7692.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  7693.  Date, time, or size ranges anywhere on the line apply to all source files. 
  7694.  
  7695.  Usage 
  7696.  
  7697.  The MOVE command moves one or more files from one directory to another, 
  7698.  whether the directories are on the same drive or not.  It has the same effect 
  7699.  as copying the files to a new location and then deleting the originals.  Like 
  7700.  COPY and RENAME, MOVE works with single files, multiple files, and sets of 
  7701.  files specified with an include list. 
  7702.  
  7703.  The simplest MOVE command moves a single source file to a new location and, 
  7704.  optionally, gives it a new name.  These two examples both move one file from 
  7705.  drive C: to the root directory on drive A: 
  7706.  
  7707.           [c:\] move myfile.dat a:\
  7708.           [c:\] move myfile.dat a:\savefile.dat
  7709.  
  7710.  In both cases, MYFILE.DAT is removed from drive C: after it has been copied to 
  7711.  drive A:.  If a file called MYFILE.DAT in the first example, or SAVEFILE.DAT 
  7712.  in the second example, already existed on drive A:, it would be overwritten. 
  7713.  (This demonstrates the difference between MOVE and RENAME.  MOVE will move 
  7714.  files between drives and will overwrite the destination file if it exists; 
  7715.  RENAME will not.) 
  7716.  
  7717.  If you MOVE multiple files, the destination must be a directory name.  MOVE 
  7718.  will move each file into the destination directory with its original name (if 
  7719.  the target is not a directory, MOVE will display an error message and exit): 
  7720.  
  7721.           [c:\] move *.wks *.txt c:\finance\myfiles
  7722.  
  7723.  You cannot move a file to a character device like the printer, or to itself. 
  7724.  
  7725.  When you move files to another directory, if you add a backslash [\] to the 
  7726.  end of the destination name MOVE will display an error message if the name 
  7727.  does not refer to an existing directory. You can use this feature to keep MOVE 
  7728.  from treating a mistyped destination directory name as a file name, and 
  7729.  attempting to move all source files to that name.  The /D option performs the 
  7730.  same function but will also prompt to see if you want to create the 
  7731.  destination directory if it doesn't exist. 
  7732.  
  7733.  Be careful when you use MOVE with the SELECT command.  If you SELECT multiple 
  7734.  files and the target is not a directory (for example, because of a 
  7735.  misspelling), MOVE will assume it is a file name.  In this case each file will 
  7736.  be moved in turn to the target file, overwriting the previous file, and then 
  7737.  the original will be erased before the next file is moved.  At the end of the 
  7738.  command, all of the original files will have been erased and only the last 
  7739.  file will exist as the target file.  You can avoid this problem by using 
  7740.  square brackets with SELECT instead of parentheses (be sure that you don't 
  7741.  allow the command line to get too long -- watch the character count in the 
  7742.  upper left corner while you're selecting files).  MOVE will then receive one 
  7743.  list of files to move instead of a series of individual filenames, and it will 
  7744.  detect the error and halt.  You can also add a backslash [\] to the end of the 
  7745.  destination name to ensure that it is the name of a subdirectory (see above). 
  7746.  
  7747.  OVE first attempts to rename the file(s), which is the fastest way to move 
  7748.  files between subdirectories on the same drive.  If that fails (the 
  7749.  destination is on a different drive or already exists), MOVE will copy the 
  7750.  file(s) and then delete the originals. 
  7751.  
  7752.  If MOVE must physically copy the files and delete the originals, rather than 
  7753.  renaming them (see above), then some disk space may be freed on the source 
  7754.  drive.  The free space may be the result of moving the files to another drive, 
  7755.  or of overwriting a larger destination file with a smaller source file.  MOVE 
  7756.  displays the amount of disk space recovered unless the /Q option is used (see 
  7757.  below).  It does so by comparing the amount of free disk space before and 
  7758.  after the MOVE command is executed.  However, this amount may be incorrect if 
  7759.  you are using a deletion tracking system which stores deleted files in a 
  7760.  hidden directory, or if, under a multitasking system, another program performs 
  7761.  a file operation while the MOVE command is executed. 
  7762.  
  7763.  When physically copying files, MOVE preserves the hidden, system, and 
  7764.  read-only attributes of the source files, and sets the archive attribute of 
  7765.  the destination files.  However, if the files can be renamed, and no copying 
  7766.  is required, then the source file attributes are not changed. 
  7767.  
  7768.  Options 
  7769.  
  7770.     /C:     (Changed files) Move files only if the destination file exists and 
  7771.             is older than the source (see also /U).  This option is useful for 
  7772.             updating the files in one directory from those in another without 
  7773.             moving any newly-created files. 
  7774.  
  7775.     /D:     (Directory) Requires that the destination be a directory.  If the 
  7776.             destination does not exist, MOVE will prompt to see if you want to 
  7777.             create it. If the destination exists as a file, MOVE will fail with 
  7778.             an "Access denied" error.  Use this option to avoid having MOVE 
  7779.             accidentally interpret your destination name as a file name when 
  7780.             it's really a mistyped directory name. 
  7781.  
  7782.     /F:     (Force delete) This option only works in the 32-bit version of 
  7783.             4OS2.  It forces deletion of the source file without saving it to 
  7784.             the DELDIR directory (if DELDIR is not in use, /F has no effect). 
  7785.  
  7786.     /H:     (Hidden) Move all files, including hidden and system files. 
  7787.  
  7788.     /N:     (Nothing) Do everything except actually move the file(s). This 
  7789.             option is most useful for testing what a complex MOVE command will 
  7790.             do. 
  7791.  
  7792.     /P:     (Prompt) Prompt the user to confirm each move.  Your options at the 
  7793.             prompt are explained in detail under Page and File Prompts. 
  7794.  
  7795.     /Q:     (Quiet) Don't display filenames, the total number of files moved, 
  7796.             or the amount of disk space recovered, if any.  This option is most 
  7797.             often used in batch files. See also /T. 
  7798.  
  7799.     /R:     (Replace) Prompt for a Y or N response before overwriting an 
  7800.             existing destination file. 
  7801.  
  7802.     /S:     (Subdirectories) Move an entire subdirectory tree to another 
  7803.             location.  MOVE will attempt to create the destination directories 
  7804.             if they don't exist, and will remove empty subdirectories after the 
  7805.             move. When /D is used with /S, you will be prompted if the first 
  7806.             destination directory does not exist, but subdirectories below that 
  7807.             will be created automatically by MOVE.  If you attempt to use /S to 
  7808.             move a subdirectory tree into part of itself, MOVE will display an 
  7809.             error message and halt. 
  7810.  
  7811.     /T:     (Total) Don't display filenames as they are moved, but display the 
  7812.             total number of files deleted and the amount of free disk space 
  7813.             recovered, if any. 
  7814.  
  7815.     /U:     (Update) Move each source file only if it is newer than a matching 
  7816.             destination file or if a matching destination file does not exist 
  7817.             (also see /C).  This option is useful for moving new or changed 
  7818.             files from one directory to another. 
  7819.  
  7820.  
  7821. ΓòÉΓòÉΓòÉ 14.50. ON - Handle Ctrl-Break and errors in batch files ΓòÉΓòÉΓòÉ
  7822.  
  7823.  Purpose:    Execute a command in a batch file when a specific condition 
  7824.              occurs. 
  7825.  
  7826.  Format:     ON BREAK [command ] 
  7827.                 or 
  7828.              ON ERROR [command ] 
  7829.  
  7830.  Usage 
  7831.  
  7832.  ON can only by used in batch files. 
  7833.  
  7834.  ON sets a "watchdog" that remains in effect for the duration of the current 
  7835.  batch file.  Whenever a BREAK or ERROR condition occurs after ON has been 
  7836.  executed, the command is automatically executed. 
  7837.  
  7838.  ON BREAK will execute its command if the user presses Ctrl- C or Ctrl-Break. 
  7839.  
  7840.  ON ERROR will execute its command after any command processor or operating 
  7841.  system error (including critical errors). That is, ON ERROR will detect errors 
  7842.  such as a disk write error, and 4OS2 errors such as a COPY command that fails 
  7843.  to copy any files, or the use of an unacceptable command option. 
  7844.  
  7845.  ON BREAK and ON ERROR are independent of each other.  You can use either one, 
  7846.  or both, in any batch file. 
  7847.  
  7848.  Each time ON BREAK or ON ERROR is used, it defines a new command to be 
  7849.  executed for a break or error, and any old command is discarded.  If you use 
  7850.  ON BREAK or ON ERROR with no following command, that type of error handling is 
  7851.  disabled. Error handling is also automatically disabled when the batch file 
  7852.  exits. 
  7853.  
  7854.  ON BREAK and ON ERROR only affect the current batch file.  If you CALL another 
  7855.  batch file, the first batch file's error handling is suspended, and the CALLed 
  7856.  file must define its own error handling. When control returns to the first 
  7857.  batch file, its error handling is reactivated. 
  7858.  
  7859.  The command can be any command that can be used on a batch file line by 
  7860.  itself.  Frequently, it is a GOTO or GOSUB command.  For example, the 
  7861.  following fragment traps any user attempt to end the batch file by pressing 
  7862.  Ctrl-C or Ctrl-Break.  It scolds the user for trying to end the batch file and 
  7863.  then continues displaying the numbers from 1 to 1000: 
  7864.  
  7865.           on break gosub gotabreak
  7866.           do i = 1 to 1000
  7867.              echo %i
  7868.           enddo
  7869.           quit
  7870.           :gotabreak
  7871.           echo Hey!  Stop that!!
  7872.           return
  7873.  
  7874.  You can use a command group as the command if you want to execute multiple 
  7875.  commands, for example: 
  7876.  
  7877.           on break (echo Oops, got a break! & quit)
  7878.  
  7879.  ON BREAK and ON ERROR always assume that you want to continue executing the 
  7880.  batch file.  After the command is executed, control automatically returns to 
  7881.  the next command in the batch file (the command after the one that was 
  7882.  interrupted by the break or error).  The only way to avoid continuing the 
  7883.  batch file after a break or error is for the command to transfer control to 
  7884.  another point with GOTO, end the batch file with QUIT or CANCEL, or start 
  7885.  another batch file (without CALLing it). 
  7886.  
  7887.  When handling an error condition with ON ERROR, you may find it useful to use 
  7888.  internal variables, particularly %_? and %_SYSERR, to help determine the cause 
  7889.  of the error. 
  7890.  
  7891.  Caution:  If a break or error occurs while the command specified in ON BREAK 
  7892.  or ON ERROR is executing, the command will be restarted. This means you must 
  7893.  use caution to avoid or handle any possible errors in the commands invoked by 
  7894.  ON ERROR, since such errors can cause an infinite loop. 
  7895.  
  7896.  
  7897. ΓòÉΓòÉΓòÉ 14.51. PATH - Set the executable file search path ΓòÉΓòÉΓòÉ
  7898.  
  7899.  Purpose:    Display or alter the list of directories that 4OS2 will search for 
  7900.              executable files, batch files, and files with executable 
  7901.              extensions that are not in the current directory. 
  7902.  
  7903.  Format:     PATH [directory [;directory...]] 
  7904.  
  7905.              directory :  The full name of a directory to include in the path 
  7906.              setting. 
  7907.  
  7908.  See also:  ESET and SET. 
  7909.  
  7910.  Usage 
  7911.  
  7912.  When 4OS2 is asked to execute an external command (a .COM, .EXE, .BTM, .BAT, 
  7913.  or .CMD file or executable extension), it first looks for the file in the 
  7914.  current directory. If it fails to find an executable file there, it then 
  7915.  searches each of the directories specified in the PATH setting. 
  7916.  
  7917.  For example, after the following PATH command, 4OS2 will search for an 
  7918.  executable file in four directories:  the current directory, then the root 
  7919.  directory on drive C, then the DOS subdirectory on C, and then the UTIL 
  7920.  subdirectory on C: 
  7921.  
  7922.           [c:\] path c:\;c:\dos;c:\util
  7923.  
  7924.  The list of directories to search can be set or viewed with the PATH command. 
  7925.  The list is stored as an environment string, and can also be set or viewed 
  7926.  with SET, and edited with ESET. 
  7927.  
  7928.  Directory names in the path must be separated by semicolons [;].  Each 
  7929.  directory name is shifted to upper case to maintain compatibility with 
  7930.  programs which can only recognize upper case directory names in the path.  If 
  7931.  you modify your path with the SET or ESET command, you may include directory 
  7932.  names in lower case.  These may cause trouble with some programs, which assume 
  7933.  that all path entries have been shifted to upper case. 
  7934.  
  7935.  If you enter PATH with no parameters, the current path is displayed: 
  7936.  
  7937.           [c:\] path
  7938.           PATH=C:\;C:\DOS;C:\UTIL
  7939.  
  7940.  Entering PATH and a semicolon clears the search path so that only the current 
  7941.  directory is searched for executable files (this is the default at system 
  7942.  startup). 
  7943.  
  7944.  Some applications also use the PATH to search for their data files. 
  7945.  
  7946.  If you include an explicit file extension on a command name (for example, 
  7947.  WP.EXE ), the search will find files with that name and extension in the 
  7948.  current directory and every directory in the path. It will not locate other 
  7949.  executable files with the same base name. 
  7950.  
  7951.  If you have an entry in the path which consists of a single period [.], the 
  7952.  current directory will not be searched first, but instead will be searched 
  7953.  when 4OS2 reaches the "." in the path. This allows you to delay the search of 
  7954.  the current directory for executable files and files with executable 
  7955.  extensions.  In rare cases, this feature may not be compatible with 
  7956.  applications which use the path to find their files; if you experience a 
  7957.  problem, you will have to remove the "." from the path while using any such 
  7958.  application. 
  7959.  
  7960.  To create a path longer than the command-line length limit, use PATH 
  7961.  repeatedly to append additional directories to the path: 
  7962.  
  7963.           path [first list of directories]
  7964.           path %path;[second list of directories]
  7965.           ...
  7966.  
  7967.  You cannot use this method to extend the path beyond 2042 characters (the 
  7968.  internal buffer limit, with room for "PATH ").  It is usually more efficient 
  7969.  to use aliases to load application programs than to create a long PATH.  See 
  7970.  ALIAS for details. 
  7971.  
  7972.  If you specify an invalid directory in the path, it will be skipped and the 
  7973.  search will continue with the next directory in the path. 
  7974.  
  7975.  
  7976. ΓòÉΓòÉΓòÉ 14.52. PAUSE - Suspend batch file or alias execution ΓòÉΓòÉΓòÉ
  7977.  
  7978.  Purpose:    Suspend batch file or alias execution. 
  7979.  
  7980.  Format:     PAUSE [text ] 
  7981.  
  7982.              text :  The message to be displayed as a user prompt. 
  7983.  
  7984.  Usage 
  7985.  
  7986.  A PAUSE command will suspend execution of a batch file or alias, giving you 
  7987.  the opportunity to change disks, turn on the printer, etc. 
  7988.  
  7989.  PAUSE waits for any key to be pressed and then continues execution. You can 
  7990.  specify the text that PAUSE displays while it waits for a keystroke, or let 
  7991.  4OS2 use the default message: 
  7992.  
  7993.           Press any key when ready...
  7994.  
  7995.  For example, the following batch file fragment prompts the user before erasing 
  7996.  files: 
  7997.  
  7998.           pause Press Ctrl-C to abort, any other key to erase all .LST files
  7999.           erase *.lst
  8000.  
  8001.  If you press Ctrl-C or Ctrl-Break while PAUSE is waiting for a key, execution 
  8002.  of an alias will be terminated, and execution of a batch file will be 
  8003.  suspended while you are asked whether to cancel the batch job.  In a batch 
  8004.  file you can handle Ctrl-C and Ctrl-Break yourself with the ON BREAK command. 
  8005.  
  8006.  
  8007. ΓòÉΓòÉΓòÉ 14.53. POPD - Restore the disk drive and directory ΓòÉΓòÉΓòÉ
  8008.  
  8009.  Purpose:    Return to the disk drive and directory at the top of the directory 
  8010.              stack.. 
  8011.  
  8012.  Format:     POPD [*] 
  8013.  
  8014.  See also:  DIRS and PUSHD. 
  8015.  
  8016.  Usage 
  8017.  
  8018.  Each time you use the PUSHD command, it saves the current disk drive and 
  8019.  directory on the internal directory stack.  POPD restores the last drive and 
  8020.  directory that was saved with PUSHD and removes that entry from the stack. 
  8021.  You can use these commands together to change directories, perform some work, 
  8022.  and return to the starting drive and directory. 
  8023.  
  8024.  Directory changes made with POPD are recorded for display in the directory 
  8025.  history window. 
  8026.  
  8027.  This example saves and changes the current disk drive and directory with 
  8028.  PUSHD, and then restores it.  The current directory is shown in the prompt: 
  8029.  
  8030.           [c:\] pushd d:\database\test
  8031.           [d:\database\test] popd
  8032.           [c:\]
  8033.  
  8034.  You can use the DIRS command to see the complete list of saved drives and 
  8035.  directories (the directory stack). 
  8036.  
  8037.  The POPD command followed by an asterisk [*] clears the directory stack 
  8038.  without changing the current drive and directory. 
  8039.  
  8040.  If the directory on the top of the stack is not on the current drive, POPD 
  8041.  will switch to the drive and directory on the top of the stack without 
  8042.  changing the default directory on the current drive. 
  8043.  
  8044.  
  8045. ΓòÉΓòÉΓòÉ 14.54. PROMPT - Change the command-line prompt ΓòÉΓòÉΓòÉ
  8046.  
  8047.  Purpose:    Change the command-line prompt. 
  8048.  
  8049.  Format:     PROMPT [text ] 
  8050.  
  8051.              text :  Text to be used as the new command-line prompt. 
  8052.  
  8053.  Usage 
  8054.  
  8055.  You can change and customize the command-line prompt at any time. The prompt 
  8056.  can include normal text, and system information such as the current drive and 
  8057.  directory, the time and date, and the amount of memory available.  You can 
  8058.  create an informal "Hello, Bob!" prompt or an official-looking prompt full of 
  8059.  impressive information. The prompt text can contain special commands in the 
  8060.  form $?, where ? is one of the characters listed below: 
  8061.  
  8062.         b     The vertical bar character [|]. 
  8063.         c     The open parenthesis [(]. 
  8064.         d     Current date, in the format:  Fri  1-07-94 (the month, day, and 
  8065.               year are formatted according to your current country settings). 
  8066.         D     Current date, in the format:  Fri  Jan 7, 1994. 
  8067.         e     The ASCII ESC character (decimal 27). 
  8068.         f     The close parenthesis [)]. 
  8069.         g     The > character. 
  8070.         h     Backspace over the previous character. 
  8071.         i     Display the OS/2 prompt header line, which reminds you of how to 
  8072.               return to the OS/2 desktop, or get help. 
  8073.         l     The < character. 
  8074.         n     Current drive letter. 
  8075.         p     Current drive and directory (lower case). 
  8076.         P     Current drive and directory (upper case). 
  8077.         q     The = character. 
  8078.         r     The numeric exit code of the last external command. 
  8079.         s     The space character. 
  8080.         t     Current 24-hour time, in the format hh:mm:ss. 
  8081.         T     Current 12-hour time, in the format hh:mm:ss[a|p]. 
  8082.         v     Operating system version number, in the format 3.10. 
  8083.         xd:   Current directory on drive d:, in lower case. 
  8084.         Xd:   Current directory on drive d:, in upper case. 
  8085.         z     Current shell nesting level; the primary command processor is 
  8086.               shell 0. 
  8087.         $     The $ character. 
  8088.         _     CR/LF (go to beginning of a new line). 
  8089.  
  8090.  For example, to set the prompt to the current date and time, with a ">" at the 
  8091.  end: 
  8092.  
  8093.           [c:\] prompt $d $t $g
  8094.           Fri  Dec 3, 1993 10:29:19 >
  8095.  
  8096.  To set the prompt to the current date and time, followed by the current drive 
  8097.  and directory in upper case on the next line, with a ">" at the end: 
  8098.  
  8099.           [c:\] prompt $d $t$_$P$g
  8100.           Fri  Dec 3, 1993 10:29:19
  8101.           [c:\]
  8102.  
  8103.  The 4OS2 prompt can be set in CONFIG.SYS (see below), and the prompt for any 
  8104.  command processor can be set in 4START, or in any batch file that runs when 
  8105.  4OS2 starts. 
  8106.  
  8107.  The 4OS2 default prompt is [$n] (drive name in square brackets) on floppy 
  8108.  drives, and [$p] (current drive and directory in square brackets) on all other 
  8109.  drives.  When OS/2 is installed, it inserts a SET PROMPT statement in 
  8110.  CONFIG.SYS to set the prompt to $i[$p].  This prompt will override the 4OS2 
  8111.  defaults.  The $i adds a header line to the default prompt to remind you of 
  8112.  certain OS/2 keystrokes.  You must delete this statement if you want to use 
  8113.  the default prompt. 
  8114.  
  8115.  If you enter PROMPT with no arguments, the prompt will be reset to its default 
  8116.  value.  The PROMPT command sets the environment variable PROMPT, so to view 
  8117.  the current prompt setting use the command: 
  8118.  
  8119.           [c:\] set prompt
  8120.  
  8121.  (If the prompt is not set at all, the PROMPT environment variable will not be 
  8122.  used, in which case the SET command above will give a "Not in environment" 
  8123.  error.) 
  8124.  
  8125.  Along with literal text, special characters, and ANSI sequences you can 
  8126.  include the text of any environment variable, internal variable, or variable 
  8127.  function in a prompt.  For example, if you want to include the size of the 
  8128.  largest free memory block in the command prompt, plus the current drive and 
  8129.  directory, you could use this command: 
  8130.  
  8131.           [c:\] prompt (%%@dosmem[K]K) $p$g
  8132.           (601K) [c:\data]
  8133.  
  8134.  Notice that the @DOSMEM function is shown with two leading percent signs [%]. 
  8135.  If you used only one percent sign, the @DOSMEM function would be expanded once 
  8136.  when the PROMPT command was executed, instead of every time the prompt is 
  8137.  displayed.  As a result, the amount of memory would never change from the 
  8138.  value it had when you entered the PROMPT command.  You can also use back 
  8139.  quotes to delay expanding the variable function until the prompt is displayed: 
  8140.  
  8141.           [c:\] prompt `(%@dosmem[K]K) $p$g`
  8142.  
  8143.  You can include ANSI escape sequences in the PROMPT text.  See ANSI for 
  8144.  complete details on ANSI commands.  This example uses ANSI sequences to set a 
  8145.  prompt that displays the shell level, date, time and path in color on the top 
  8146.  line of the screen (enter the command as one line): 
  8147.  
  8148.           [c:\] prompt $e[s$e[1;1f$e[41;1;37m$e[K[$z] $d
  8149.                 Time: $t$h$h$h  Path: $p$e[u$e[0;32m$n$g
  8150.  
  8151.  You may find it helpful to define a different prompt in secondary shells, 
  8152.  perhaps including $z in the prompt to display the shell level.  To do so, 
  8153.  place a PROMPT command in your 4START file and use IF or IFF statements to set 
  8154.  the appropriate prompt for different shells. 
  8155.  
  8156.  
  8157. ΓòÉΓòÉΓòÉ 14.55. PUSHD - Save the disk drive and directory ΓòÉΓòÉΓòÉ
  8158.  
  8159.  Purpose:    Save the current disk drive and directory, optionally changing to 
  8160.              a new drive and directory. 
  8161.  
  8162.  Format:     PUSHD [pathname ] 
  8163.  
  8164.              pathname :  The name of the new default drive and directory. 
  8165.  
  8166.  See also:  DIRS, POPD and the CDPATH environment variable. 
  8167.  
  8168.  Usage 
  8169.  
  8170.  PUSHD saves the current drive and directory on a "last in, first out" 
  8171.  directory stack.  The POPD command returns to the last drive and directory 
  8172.  that was saved by PUSHD.  You can use these commands together to change 
  8173.  directories, perform some work, and return to the starting drive and 
  8174.  directory.  The DIRS command displays the contents of the directory stack. 
  8175.  
  8176.  To save the current drive and directory, without changing directories, use the 
  8177.  PUSHD command by itself, with no pathname. 
  8178.  
  8179.  If a pathname is specified as part of the PUSHD command, the current drive and 
  8180.  directory are saved and PUSHD changes to the specified drive and directory. 
  8181.  If the pathname includes a drive letter, PUSHD changes to the specified 
  8182.  directory on the new drive without changing the current directory on the 
  8183.  original drive. 
  8184.  
  8185.  This example saves the current directory and changes to C:\WORDP\MEMOS, then 
  8186.  returns to the original directory: 
  8187.  
  8188.           [c:\] pushd \wordp\memos
  8189.           [c:\wordp\memos] popd
  8190.           [c:\]
  8191.  
  8192.  Directory changes made with PUSHD are recorded for display in the directory 
  8193.  history window. 
  8194.  
  8195.  The directory stack can hold up to 255 characters, or about 10 to 20 entries 
  8196.  (depending on the length of the names).  If you exceed this limit, the oldest 
  8197.  entry is removed before adding a new entry. 
  8198.  
  8199.  If PUSHD can't change directly to the specified directory, it will look for 
  8200.  the CDPATH variable; see CDPATH for details. 
  8201.  
  8202.  
  8203. ΓòÉΓòÉΓòÉ 14.56. QUIT - Terminate a batch file ΓòÉΓòÉΓòÉ
  8204.  
  8205.  Purpose:    Terminate the current batch file. 
  8206.  
  8207.  Format:     QUIT [value ] 
  8208.  
  8209.              value :  The exit code from 0 to 255 to return to 4OS2 or to the 
  8210.              previous batch file. 
  8211.  
  8212.  See also:  CANCEL. 
  8213.  
  8214.  Usage 
  8215.  
  8216.  QUIT provides a simple way to exit a batch file before reaching the end of the 
  8217.  file.  If you QUIT a batch file called from another batch file, you will be 
  8218.  returned to the previous file at the line following the original CALL. 
  8219.  
  8220.  QUIT only ends the current batch file.  To end all batch file processing, use 
  8221.  the CANCEL command. 
  8222.  
  8223.  If you specify a value, QUIT will set the ERRORLEVEL or exit code (see the IF 
  8224.  command, and the %? variable) to that value. 
  8225.  
  8226.  You can also use QUIT to terminate an alias.  If you QUIT an alias while 
  8227.  inside a batch file, QUIT will end both the alias and the batch file and 
  8228.  return you to the command prompt or to the calling batch file. 
  8229.  
  8230.  
  8231. ΓòÉΓòÉΓòÉ 14.57. RD - Remove subdirectories ΓòÉΓòÉΓòÉ
  8232.  
  8233.  Purpose:    Remove one or more subdirectories. 
  8234.  
  8235.  Format:     RD pathname... 
  8236.                 or 
  8237.              RMDIR pathname... 
  8238.  
  8239.              pathname :  The name of a subdirectory to remove. 
  8240.  
  8241.  See also:  MD. 
  8242.  
  8243.  File Selection 
  8244.  
  8245.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  8246.  
  8247.  Usage 
  8248.  
  8249.  RD and RMDIR are synonyms.  You can use either one. 
  8250.  
  8251.  RD removes directories from the directory tree.  For example, to remove the 
  8252.  subdirectory MEMOS from the subdirectory WP, you can use this command: 
  8253.  
  8254.           [c:\] rd \wp\memos
  8255.  
  8256.  Before using RD, you must delete all files and subdirectories (and their 
  8257.  files) in the pathname you want to remove.  Remember to remove hidden and 
  8258.  read-only files as well as normal files (you can use DEL /Z to delete hidden 
  8259.  and read-only files). 
  8260.  
  8261.  You can use wildcards in the pathname. 
  8262.  
  8263.  You cannot remove the root directory, the current directory (.), any directory 
  8264.  above the current directory in the directory tree, or any directory in use by 
  8265.  another process in a multitasking system. 
  8266.  
  8267.  
  8268. ΓòÉΓòÉΓòÉ 14.58. REBOOT - Reboot the system ΓòÉΓòÉΓòÉ
  8269.  
  8270.  Purpose:    Do a system reboot. 
  8271.  
  8272.  Format:     REBOOT [/C /S /V] 
  8273.  
  8274.              /S(hutdown)                     /V(erify) 
  8275.  
  8276.  Usage 
  8277.  
  8278.  REBOOT will completely restart your computer.  It normally performs a warm 
  8279.  reboot, which is comparable to pressing Ctrl-Alt-Delete. A reboot is necessary 
  8280.  to activate any changes to your CONFIG.SYS file. 
  8281.  
  8282.  The following example prompts you to verify the reboot, then does a warm boot: 
  8283.  
  8284.           [c:\] reboot /v
  8285.  
  8286.  REBOOT defaults to performing a warm boot, with no prompting. 
  8287.  
  8288.  REBOOT flushes the disk buffers, resets the drives, and waits one second 
  8289.  before rebooting, to allow disk caching programs to finish writing any cached 
  8290.  data.  4OS2 issues the proper commands to shut down OS/2 before rebooting. 
  8291.  
  8292.  REBOOT uses the DOS.SYS device driver to reboot your system.  DOS.SYS is 
  8293.  loaded via a DEVICE= statement in your CONFIG.SYS file.  If DOS.SYS is not 
  8294.  loaded, REBOOT will not work. 
  8295.  
  8296.  Options 
  8297.  
  8298.     /S:     (Shutdown) Shut down the system, but do not reboot.  This option is 
  8299.             equivalent to clicking the "Shutdown" choice on the OS/2 2.x 
  8300.             Workplace Shell popup menu. 
  8301.  
  8302.     /V:     (Verify) Prompt for confirmation (Y or N) before rebooting. 
  8303.  
  8304.  
  8305. ΓòÉΓòÉΓòÉ 14.59. REM - Put a comment in a batch file ΓòÉΓòÉΓòÉ
  8306.  
  8307.  Purpose:    Put a comment in a batch file. 
  8308.  
  8309.  Format:     REM [comment ] 
  8310.  
  8311.              comment :  The text to include in the batch file. 
  8312.  
  8313.  Usage 
  8314.  
  8315.  The REM command lets you place a remark or comment in a batch file. Batch file 
  8316.  comments are useful for documenting the purpose of a batch file and the 
  8317.  procedures you have used. 
  8318.  
  8319.  REM must be followed by a space or tab character and then your comment. 
  8320.  Comments can be up to 1023 characters long.  4OS2 will normally ignore 
  8321.  everything on the line after the REM command, including quote characters, 
  8322.  redirection symbols, and other commands (see below for the exception to this 
  8323.  rule). 
  8324.  
  8325.  If ECHO is ON, the comment is displayed.  Otherwise, it is ignored. If ECHO is 
  8326.  ON and you don't want to display the line, preface the REM command with an at 
  8327.  sign [@]. 
  8328.  
  8329.  You can use REM to create a zero-byte file if you use a redirection symbol 
  8330.  immediately after the REM command.  For example, to create the zero-byte file 
  8331.  C:\FOO : 
  8332.  
  8333.           [c:\] rem>foo
  8334.  
  8335.  (This capability is included for compatibility with CMD.EXE.  A simpler method 
  8336.  for creating a zero-byte file with 4OS2 is to enter  >filename as a command, 
  8337.  with no actual command before the [>] redirection character.) 
  8338.  
  8339.  
  8340. ΓòÉΓòÉΓòÉ 14.60. REN - Rename files or subdirectories ΓòÉΓòÉΓòÉ
  8341.  
  8342.  Purpose:    Rename files or subdirectories. 
  8343.  
  8344.  Format:     REN [/N /P /Q /S /T] old_name... new_name 
  8345.                 or 
  8346.              RENAME [/N /P /Q /S /T] old_name... new_name 
  8347.  
  8348.              old_name :  Original name of the file(s) or subdirectory. 
  8349.              new_name :  New name to use, or new path on the same drive. 
  8350.  
  8351.              /N(othing)                      /S(ubdirectory) 
  8352.              /P(rompt)                       /T(otal) 
  8353.              /Q(uiet) 
  8354.  
  8355.  See also:  COPY and MOVE. 
  8356.  
  8357.  File Selection 
  8358.  
  8359.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  8360.  
  8361.  Usage 
  8362.  
  8363.  REN and RENAME are synonyms.  You may use either one. 
  8364.  
  8365.  REN lets you change the name of a file or a subdirectory, or move one or more 
  8366.  files to a new subdirectory on the same drive.  (If you want to move files to 
  8367.  a different drive, use MOVE.) 
  8368.  
  8369.  In its simplest form, you simply give REN the old_name of an existing file or 
  8370.  subdirectory and then a new_name.  The new_name must not already exist -- you 
  8371.  can't give two files the same name (unless they are in different directories). 
  8372.  The first example renames the file MEMO.TXT to MEM.TXT.  The second example 
  8373.  changes the name of the \WORD directory to \WP : 
  8374.  
  8375.           [c:\] rename memo.txt mem.txt
  8376.           [c:\] rename \word \wp
  8377.  
  8378.  You can also use REN to rename a group of files that you specify with 
  8379.  wildcards, as multiple files, or in an include list.  When you do, the 
  8380.  new_name must use one or more wildcards to show what part of each filename to 
  8381.  change.  Both of the next two examples change the extensions of multiple files 
  8382.  to .SAV : 
  8383.  
  8384.           [c:\] ren config.sys autoexec.bat 4start.btm *.sav
  8385.           [c:\] ren *.txt *.sav
  8386.  
  8387.  REN can move files to a different subdirectory on the same drive. When it is 
  8388.  used for this purpose, REN requires one or more filenames for the old_name and 
  8389.  a directory name for the new_name : 
  8390.  
  8391.           [c:\] ren memo.txt \wp\memos\
  8392.           [c:\] ren oct.dat nov.dat \data\save\
  8393.  
  8394.  The final backslash in the last two examples is optional.  If you use it, you 
  8395.  force REN to recognize the last argument as the name of a directory, not a 
  8396.  file.  The advantage of this approach is that if you accidentally mistype the 
  8397.  directory name, REN will report an error instead of renaming your files in a 
  8398.  way that you didn't intend. 
  8399.  
  8400.  Finally, REN can move files to a new directory and change their name at the 
  8401.  same time if you specify both a path and file name for new_name.  In this 
  8402.  example, the files are renamed with an extension of .SAV as they are moved to 
  8403.  a new directory: 
  8404.  
  8405.           [c:\] ren *.dat \data\save\*.sav
  8406.  
  8407.  When new_name refers to a file or files (rather than a directory), the file(s) 
  8408.  must not already exist.  Also, you cannot rename a subdirectory to a new 
  8409.  location on the directory tree. 
  8410.  
  8411.  REN does not change a file's attributes.  The new_name file(s) will have the 
  8412.  same attributes as old_name. 
  8413.  
  8414.  Options 
  8415.  
  8416.     /N:     (Nothing) Do everything except actually rename the file(s). This 
  8417.             option is useful for testing what a REN command will actually do. 
  8418.  
  8419.     /P:     (Prompt) Prompt the user to confirm each rename operation. Your 
  8420.             options at the prompt are explained in detail under Page and File 
  8421.             Prompts. 
  8422.  
  8423.     /Q:     (Quiet) Don't display filenames  or the number of files renamed. 
  8424.             This option is most often used in batch files.  See also /T. 
  8425.  
  8426.     /S:     (Subdirectory) Normally, you can rename a subdirectory only if you 
  8427.             do not use any wildcards in the new_name.  This prevents 
  8428.             subdirectories from being renamed inadvertently when a group of 
  8429.             files is being renamed with wildcards.  /S will let you rename a 
  8430.             subdirectory even when you use wildcards. 
  8431.  
  8432.     /T:     (Total) Don't display filenames as they are renamed, but report the 
  8433.             number of files renamed.  See also /Q. 
  8434.  
  8435.  
  8436. ΓòÉΓòÉΓòÉ 14.61. RETURN - Return from a subroutine in a batch file ΓòÉΓòÉΓòÉ
  8437.  
  8438.  Purpose:    Return from a GOSUB (subroutine) in a batch file. 
  8439.  
  8440.  Format:     RETURN 
  8441.  
  8442.  See also:  GOSUB. 
  8443.  
  8444.  Usage 
  8445.  
  8446.  4OS2 allows subroutines in batch files. 
  8447.  
  8448.  A subroutine begins with a label (a colon followed by a word) and ends with a 
  8449.  RETURN command. 
  8450.  
  8451.  The subroutine is invoked with a GOSUB command from another part of the batch 
  8452.  file.  When a RETURN command is encountered the subroutine terminates, and 
  8453.  execution of the batch file continues on the line following the original 
  8454.  GOSUB. 
  8455.  
  8456.  The following batch file fragment calls a subroutine which displays the files 
  8457.  in the current directory: 
  8458.  
  8459.           echo Calling a subroutine
  8460.           gosub subr1
  8461.           echo Returned from the subroutine
  8462.           quit
  8463.  
  8464.           :subr1
  8465.           dir /a/w
  8466.           return
  8467.  
  8468.  
  8469. ΓòÉΓòÉΓòÉ 14.62. SCREEN - Position the cursor and display text ΓòÉΓòÉΓòÉ
  8470.  
  8471.  Purpose:    Position the cursor on the screen and optionally display a 
  8472.              message. 
  8473.  
  8474.  Format:     SCREEN row column [text ] 
  8475.  
  8476.              row :  The new row location for the cursor. 
  8477.              column :  The new column location for the cursor. 
  8478.              text :  Optional text to display at the new cursor location. 
  8479.  
  8480.  See also:  ECHO, SCRPUT, TEXT, and VSCRPUT. 
  8481.  
  8482.  Usage 
  8483.  
  8484.  SCREEN allows you to create attractive screen displays in batch files.  You 
  8485.  use it to specify where a message will appear on the screen.  You can use 
  8486.  SCREEN to create menu displays, logos, etc. The following batch file fragment 
  8487.  displays a menu: 
  8488.  
  8489.           @echo off
  8490.           cls
  8491.           screen 3 10  Select a number from 1 to 4:
  8492.           screen 6 20  1 - Word Processing
  8493.           ...
  8494.  
  8495.  SCREEN does not change the screen colors.  To display text in specific colors, 
  8496.  use SCRPUT or VSCRPUT.  SCREEN always leaves the cursor at the end of the 
  8497.  displayed text. 
  8498.  
  8499.  The row and column values are zero-based, so on a standard 25 line by 80 
  8500.  column display, valid rows are 0 - 24 and valid columns are 0 - 79.  You can 
  8501.  also specify the row and column as offsets from the current cursor position. 
  8502.  Begin the value with a plus sign [+] to move the cursor down the specified 
  8503.  number of rows or to the right the specified number of columns, or with a 
  8504.  minus sign [-] to move the cursor up or to the left.  This example prints a 
  8505.  string 3 lines above the current position, in absolute column 10: 
  8506.  
  8507.           screen -3 10 Hello, World!
  8508.  
  8509.  SCREEN checks for a valid row and column, and displays a "Usage" error message 
  8510.  if either value is out of range. 
  8511.  
  8512.  
  8513. ΓòÉΓòÉΓòÉ 14.63. SCRPUT - Display text in color ΓòÉΓòÉΓòÉ
  8514.  
  8515.  Purpose:    Position text on the screen and display it in color. 
  8516.  
  8517.  Format:     SCRPUT row col [BRIght] [BLInk] fg ON [BRIght] bg text 
  8518.  
  8519.              row :  Starting row 
  8520.              col :  Starting column 
  8521.              fg :  Foreground character color 
  8522.              bg :  Background character color 
  8523.              text :  The text to display 
  8524.  
  8525.  See also:  CLS, ECHO, SCREEN, TEXT, and VSCRPUT. 
  8526.  
  8527.  Usage 
  8528.  
  8529.  SCRPUT allows you to create attractive screen displays in batch files.  You 
  8530.  use it to specify where a message will appear on the screen and what colors 
  8531.  will be used to display the message text. You can use SCRPUT to create menu 
  8532.  displays, logos, etc. 
  8533.  
  8534.  SCRPUT works like SCREEN, but allows you to specify the display colors.  It 
  8535.  writes directly to the screen and does not require ANSI support.  It always 
  8536.  leaves the cursor in its current position.  See Colors and Color Names for 
  8537.  details about colors and notes on the use of bright background colors. 
  8538.  
  8539.  The row and column are zero-based, so on a standard 25 line by 80 column 
  8540.  display, valid rows are 0 - 24 and valid columns are 0 - 79.  You can also 
  8541.  specify the row and column as offsets from the current cursor position.  Begin 
  8542.  the value with a plus sign [+] to move down the specified number of rows or to 
  8543.  the right the specified number of columns, or with a minus sign [-] to move up 
  8544.  or to the left. 
  8545.  
  8546.  The following batch file fragment displays part of a menu, in color: 
  8547.  
  8548.           cls white on blue
  8549.           scrput 6 20 bri red on blu 1 - Word Processing
  8550.           scrput 7 20 bri yel on blu 2 - Spreadsheet
  8551.           ...
  8552.  
  8553.  
  8554. ΓòÉΓòÉΓòÉ 14.64. SELECT - Select files for a command ΓòÉΓòÉΓòÉ
  8555.  
  8556.  Purpose:    Interactively select files for a command. 
  8557.  
  8558.  Format:     SELECT [/A[:][-]rhsda /D /E /I"text" /O[:][-]adeginrsu /Z] 
  8559.              [command ] ... (files...)... 
  8560.  
  8561.              command :  The command to execute with the selected files. 
  8562.              files :  The files from which to select.  File names may be 
  8563.              enclosed in either parentheses or square brackets.  The difference 
  8564.              is explained below. 
  8565.  
  8566.              /A(ttribute select)             /I (match descriptions) 
  8567.              /D(isable color coding)         /O(rder) 
  8568.              /E (use upper case)             /Z (use FAT format) 
  8569.  
  8570.  File Selection 
  8571.  
  8572.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  8573.  Date, time, or size ranges must appear immediately after the SELECT keyword. 
  8574.  
  8575.  Usage 
  8576.  
  8577.  SELECT allows you to select files for internal and external commands by using 
  8578.  a full-screen "point and shoot" display.  You can have SELECT execute a 
  8579.  command once for each file you select, or have it create a list of files for a 
  8580.  command to work with.  The command can be an internal command, an alias, an 
  8581.  external command, or a batch file. 
  8582.  
  8583.  If you use parentheses around the files, SELECT executes the command once for 
  8584.  each file you have selected.  During each execution, one of the selected files 
  8585.  is passed to the command as an argument.  If you use square brackets around 
  8586.  files, the SELECTed files are combined into a single list, separated by 
  8587.  spaces.  The command is then executed once with the entire list presented as 
  8588.  its command-line arguments. 
  8589.  
  8590.  SELECT uses the cursor up, cursor down, PgUp, and PgDn keys to scroll through 
  8591.  the file list.  Use the + key or the spacebar to select a file (or unselect a 
  8592.  marked file), and the - key to unselect a file.  The * key will reverse all of 
  8593.  the current marks (excluding subdirectories), and the / key will unmark 
  8594.  everything.  After marking the files, press Enter to execute the command. 
  8595.  
  8596.  You can select a single file by moving the scroll bar to the filename and 
  8597.  pressing Enter without marking any other files. 
  8598.  
  8599.  To skip the files listed in the current display and go on to the next file 
  8600.  specification inside the parentheses or brackets (if any), press the Esc key. 
  8601.  To cancel the current SELECT command entirely, press Ctrl-C or Ctrl-Break. 
  8602.  
  8603.  In the simplest form of SELECT, you merely specify the command and then the 
  8604.  list of files from which you will make your selection(s). For example: 
  8605.  
  8606.           [c:\] select copy (*.com *.exe) a:\
  8607.  
  8608.  will let you select from among the .COM and .EXE files on the current drive. 
  8609.  It will then invoke the COPY command to copy each file you select to drive A:. 
  8610.  You will be able to select first from a list of all .COM files in the current 
  8611.  directory, and then from a list of all .EXE files. 
  8612.  
  8613.  If you want to select from a list of all the .COM and .EXE files mixed 
  8614.  together, create an include list inside the parentheses by inserting a 
  8615.  semicolon: 
  8616.  
  8617.           [c:\] select copy (*.com;*.exe) a:\
  8618.  
  8619.  Finally, if you want the SELECT command to send a single list of files to 
  8620.  COPY, instead of invoking COPY once for each file you select, put the file 
  8621.  names in square brackets instead of parentheses: 
  8622.  
  8623.           [c:\] select copy [*.com;*.exe] a:\
  8624.  
  8625.  If you use brackets, you have to be sure that the resulting command (the word 
  8626.  COPY, the list of files, and the destination drive in this example) is no more 
  8627.  than 1,023 characters long.  The current line length is displayed by SELECT 
  8628.  while you are marking files to help you to conform to this limit. 
  8629.  
  8630.  The parentheses or brackets enclosing the file name(s) can appear anywhere 
  8631.  within the command; SELECT assumes that the first set of parentheses or 
  8632.  brackets it finds is the one containing the list of files from which you wish 
  8633.  to make your selection. 
  8634.  
  8635.  The list of files from which you wish to select can be further refined by 
  8636.  using date, time, and size ranges.  The range must be placed immediately after 
  8637.  the word SELECT.  If the command is an internal command that supports ranges, 
  8638.  an independent range can also be used in the command itself. 
  8639.  
  8640.  If you don't specify a command, the selected filename(s) will become the 
  8641.  command.  For example, this command defines an alias called UTILS that selects 
  8642.  from the executable files in the directory C:\UTIL, and then executes them in 
  8643.  the order marked: 
  8644.  
  8645.           [c:\] alias utils select (c:\util\*.com;*.exe;*.btm;*.bat)
  8646.  
  8647.  If you want to use filename completion to enter the filenames inside the 
  8648.  parentheses, type a space after the opening parenthesis.  Otherwise the 
  8649.  command-line editor will treat the open parenthesis as the first character of 
  8650.  the filename. 
  8651.  
  8652.  You can set the default colors used by SELECT with the SelectColors and 
  8653.  SelectStatBarColors directives in the .INI file.  If SelectColors is not used, 
  8654.  the SELECT display will use the current default colors.  If 
  8655.  SelectStatBarColors is not used, the status bar will use the reverse of the 
  8656.  SELECT display colors. 
  8657.  
  8658.  You can display the filenames in color by setting the COLORDIR environment 
  8659.  variable or using the ColorDir directive in your .INI file.  See Color-Coded 
  8660.  Directories for details.  To disable directory color coding within SELECT, use 
  8661.  the /D option. 
  8662.  
  8663.  When displaying descriptions, SELECT adds a right arrow at the end of the line 
  8664.  if the description is too long to fit on the screen.  This symbol will alert 
  8665.  you to the existence of additional description text. 
  8666.  
  8667.  With the /I option, you can select files based on their descriptions.  SELECT 
  8668.  will display files if their description matches the text after the /I switch. 
  8669.  The search is not case sensitive.  You can use wildcards and extended wild 
  8670.  cards as part of the text. 
  8671.  
  8672.  When sorting file names and extensions for the SELECT display, 4OS2 normally 
  8673.  assumes that sequences of digits should be sorted numerically (for example, 
  8674.  the file DRAW2 would come before DRAW03 because 2 is numerically smaller than 
  8675.  03), rather than strictly alphabetically (where DRAW2 would come second 
  8676.  because "2" comes after "0").  You can defeat this behavior and force a strict 
  8677.  alphabetic sort with the /O:a option. 
  8678.  
  8679.  Options 
  8680.  
  8681.     /A:     (Attribute select)  Display only those files that have the 
  8682.             specified attribute set.  Preceding the attribute character with a 
  8683.             minus [-] will display files that do not have that attribute set. 
  8684.             Attributes can also be combined.  The attributes are: 
  8685.  
  8686.               R  Read-only 
  8687.               H  Hidden 
  8688.               S  System 
  8689.               D  Subdirectory 
  8690.               A  Archive 
  8691.  
  8692.             If no attributes are listed at all (e.g., SELECT /A ...), SELECT 
  8693.             will display all files and subdirectories including hidden and 
  8694.             system files. If attributes are combined, all the specified 
  8695.             attributes must match for a file to be included in the listing. 
  8696.             For example, /A:RHS will display only those files with all three 
  8697.             attributes set. 
  8698.  
  8699.     /D:     (Disable color coding)  Temporarily turn off directory color coding 
  8700.             within SELECT. 
  8701.  
  8702.     /E      (use upper case)  Display filenames in the traditional upper case 
  8703.             format; also see SETDOS /U and the UpperCase  directive in the .INI 
  8704.             file.  /E is ignored if the display is in HPFS format.  HPFS file 
  8705.             names are always displayed in the case in which they are stored. 
  8706.  
  8707.     /I      (match descriptions)  Display filenames by matching text in their 
  8708.             descriptions.  The text can include wild cards and extended 
  8709.             wildcards.  The search text must be enclosed in quotation marks. 
  8710.             /I will be ignored if /C or /O:c is also used. 
  8711.  
  8712.     /O:     (Order)  Set the sort order for the files.  The order can be any 
  8713.             combination of the following options: 
  8714.  
  8715.               -  Reverse the sort order for the next option 
  8716.               a  Sort in ASCII order, not numerically, when there are digits in 
  8717.             the name 
  8718.               d  Sort by date and time (oldest first); for HPFS drives also see 
  8719.             /T 
  8720.               e  Sort by extension 
  8721.               g  Group subdirectories first, then files 
  8722.               i  Sort by file description 
  8723.               n  Sort by filename (this is the default) 
  8724.               r  Reverse the sort order for all options 
  8725.               s  Sort by size 
  8726.               u  Unsorted 
  8727.  
  8728.     /Z:     Display HPFS filenames in FAT format.  Long names will be truncated 
  8729.             to 12 characters.  If the name is longer than 12 characters, it 
  8730.             will be followed by a right arrow to show that one or more 
  8731.             characters have been truncated. 
  8732.  
  8733.  
  8734. ΓòÉΓòÉΓòÉ 14.65. SET - Create or modify environment variables ΓòÉΓòÉΓòÉ
  8735.  
  8736.  Purpose:    Display, create, modify, or delete environment variables. 
  8737.  
  8738.  Format:     SET [/P /R filename...] [name [=][value ]] 
  8739.  
  8740.              filename :  The name of a file containing variable definitions. 
  8741.              name :  The name of the environment variable to define or modify. 
  8742.              value :  The new value for the variable. 
  8743.  
  8744.              /P(ause)                        /R(ead from file) 
  8745.  
  8746.  See also:  ESET and UNSET. 
  8747.  
  8748.  Usage 
  8749.  
  8750.  Every program and command inherits an environment, which is a list of variable 
  8751.  names, each of which is followed by an equal sign and some text.  Many 
  8752.  programs use entries in the environment to modify their own actions. 
  8753.  
  8754.  If you simply type the SET command with no options or arguments, it will 
  8755.  display all the names and values currently stored in the environment. 
  8756.  Typically, you will see an entry called COMSPEC, an entry called PATH, an 
  8757.  entry called CMDLINE, and whatever other environment variables you and your 
  8758.  programs have established: 
  8759.  
  8760.           [c:\] set
  8761.           COMSPEC=C:\4OS2\$OS2.EXE
  8762.           PATH=C:\;C:\OS2;C:\OS2\SYSTEM;C:\UTIL
  8763.           CMDLINE=C:\4OS2\4START.CMD
  8764.  
  8765.  To add a variable to the environment, type SET, a space, the variable name, an 
  8766.  equal sign, and the text: 
  8767.  
  8768.           [c:\] set mine=c:\finance\myfiles
  8769.  
  8770.  The variable name is converted to upper case by 4OS2.  The text after the 
  8771.  equal sign will be left just as you entered it.  If the variable already 
  8772.  exists, its value will be replaced with the new text that you entered. 
  8773.  
  8774.  Normally you should not put a space on either side of the equal sign.  A space 
  8775.  before the equal sign will become part of the name ; a space after the equal 
  8776.  sign will become part of the value. 
  8777.  
  8778.  If you use SET to create a variable with the same name as one of the 4OS2 
  8779.  internal variables, you will disable the internal variable.  If you later 
  8780.  execute a batch file or alias that depends on that internal variable, it may 
  8781.  not operate correctly. 
  8782.  
  8783.  To display the contents of a single variable, type SET plus the variable name: 
  8784.  
  8785.           [c:\] set mine
  8786.  
  8787.  You can edit environment variables with the ESET command.  To remove variables 
  8788.  from the environment, use UNSET, or type SET plus a variable name and an equal 
  8789.  sign: 
  8790.  
  8791.           [c:\] set mine=
  8792.  
  8793.  The variable name is limited to a maximum of 80 characters. The name and value 
  8794.  together cannot be longer than 1,023 characters. 
  8795.  
  8796.  In 4OS2 the size of the environment is set automatically, and increased as 
  8797.  necessary as you add variables. 
  8798.  
  8799.  Options 
  8800.  
  8801.     /P:     (Pause) Wait for a key to be pressed after each screen page before 
  8802.             continuing the display.  Your options at the prompt are explained 
  8803.             in detail under Page and File Prompts. 
  8804.  
  8805.     /R:     (Read) Read environment variables from a file.  This is much faster 
  8806.             than loading variables from a batch file with multiple SET 
  8807.             commands.  Each entry in the file must fit within the 1,023-byte 
  8808.             command-line length limit for 4OS2:  The file is in the same format 
  8809.             as the SET display, so SET /R can accept as input a file generated 
  8810.             by redirecting SET output.  For example, the following commands 
  8811.             will save the environment variables to a file, and then reload them 
  8812.             from that file: 
  8813.  
  8814.                                 set > varlist
  8815.                                 set /r varlist
  8816.  
  8817.             You can load variables from multiple files by listing the filenames 
  8818.             individually after the /R. You can add comments to a variable file 
  8819.             by starting the comment line with a colon [:]. 
  8820.  
  8821.             If you are creating a SET /R file by hand, and need to create an 
  8822.             entry that spans multiple lines in the file, you can do so by 
  8823.             terminating each line, except the last, with an escape character. 
  8824.             However, you cannot use this method to exceed the command-line 
  8825.             length limit. 
  8826.  
  8827.  
  8828. ΓòÉΓòÉΓòÉ 14.66. SETDOS - Set the 4OS2 configuration ΓòÉΓòÉΓòÉ
  8829.  
  8830.  Purpose:    Display or set the 4OS2 configuration. 
  8831.  
  8832.  Format:     SETDOS [/B? /C? /D /E? /I+|- command /L? /M? /N? /P? /R? /S?:? /U? 
  8833.              /V? /X[+|-]n /Y] 
  8834.  
  8835.              /B(right background)            /N(o clobber) 
  8836.              /C(ompound)                     /P(arameter character) 
  8837.              /D(escriptions)                 /R(ows) 
  8838.              /E(scape character)             /S(hape of cursor) 
  8839.              /I(nternal commands)            /U(pper case) 
  8840.              /L(ine)                         /V(erbose) 
  8841.              /M(ode for editing)             /X (expansion, special characters) 
  8842.                                              /Y (single step) 
  8843.  
  8844.  Usage 
  8845.  
  8846.  SETDOS allows you to customize certain aspects of 4OS2 to suit your personal 
  8847.  tastes or the configuration of your system.  Each of these options is 
  8848.  described below. 
  8849.  
  8850.  You can display the value of all SETDOS options by entering the SETDOS command 
  8851.  with no parameters. 
  8852.  
  8853.  Most of the SETDOS options can be initialized when 4OS2 executes the 
  8854.  configuration directives in the .INI file. The name of the corresponding 
  8855.  directive is listed with each option below; if none is listed, that option 
  8856.  cannot be set from the .INI file.  You can also define the SETDOS options in 
  8857.  your AUTOEXEC.BAT, 4START, or other startup file (see Automatic Batch Files), 
  8858.  in aliases, or at the command line. 
  8859.  
  8860.  Secondary shells automatically inherit most configuration settings currently 
  8861.  in effect in the previous shell.  If values have been changed by SETDOS since 
  8862.  4OS2 started, the new values will be passed to the secondary shell. 
  8863.  
  8864.  SETDOS /I settings are not inherited by secondary shells.  If you want to use 
  8865.  SETDOS /I- to disable commands in all shells, place the SETDOS command(s) in 
  8866.  your 4START file, which is executed when any shell starts. 
  8867.  
  8868.  Options 
  8869.  
  8870.     /B:     (Bright background) The BRIGHTBG option determines whether 4OS2 
  8871.             configures your video adapter for blinking text (/B0, the default) 
  8872.             or bright background colors (/B1). See Colors and Color Names for a 
  8873.             detailed discussion of this option.  Also see the BrightBG 
  8874.             directive. 
  8875.  
  8876.     /C:     (Compound character) The COMPOUND option sets the character used 
  8877.             for separating multiple commands on the same line.  The default is 
  8878.             the ampersand [&]. You cannot use any of the redirection characters 
  8879.             (| > <), or the blank, tab, comma, or equal sign as the command 
  8880.             separator.  This example changes the COMPOUND character to a tilde 
  8881.             [~]: 
  8882.  
  8883.                                 [c:\] setdos /c~
  8884.  
  8885.             If you want to share batch files or aliases between 4DOS and 4OS2 
  8886.             or 4DOS/NT, see the %+ variable, which retrieves the current 
  8887.             command separator, and 4DOS, 4OS2, and 4DOS/NT Compatibility for 
  8888.             details on using compatible command separators for all the products 
  8889.             you use.  Also see the CommandSep directive. 
  8890.  
  8891.     /D:     (Descriptions) The DESCRIPTIONS option controls whether file 
  8892.             processing commands like COPY, DEL, MOVE, and REN process file 
  8893.             descriptions along with the files they belong to.  /D1 turns 
  8894.             description processing on, which is the default.  /D0 turns 
  8895.             description processing off.  Also see the Descriptions directive. 
  8896.  
  8897.     /E:     (Escape character) The ESCAPE option sets the character used to 
  8898.             suppress the normal meaning of the following character.  Any 
  8899.             character following the escape character will be passed unmodified 
  8900.             to the command.  The default escape character is a caret [^]. You 
  8901.             cannot use any of the redirection characters (| > <) or the blank, 
  8902.             tab, comma, or equal sign as the escape character. Certain 
  8903.             characters (b, c, e, f, n, r, s, and t) have special meanings when 
  8904.             immediately preceded by the escape character. 
  8905.  
  8906.             If you want to share batch files or aliases between 4DOS and 4OS2 
  8907.             or 4DOS/NT, see the %= variable, which retrieves the current escape 
  8908.             character, and 4DOS, 4OS2, and 4DOS/NT Compatibility for details on 
  8909.             using compatible escape characters for all the products you use. 
  8910.             Also see the EscapeChar directive. 
  8911.  
  8912.     /I:     (Internal) The INTERNAL option allows you to disable or enable 
  8913.             internal commands.  To disable a command, precede the command name 
  8914.             with a minus [-].  To re-enable a command, precede it with a plus 
  8915.             [+]. For example, to disable the internal LIST command to force 
  8916.             4OS2 to use an external command: 
  8917.  
  8918.                                 [c:\] setdos /i-list
  8919.  
  8920.     /L:     (Line) The LINE option controls how 4OS2 gets its input from the 
  8921.             command line.  /L0 tells 4OS2 to use character input (the default). 
  8922.             /L1 tells it to use line input (like CMD.EXE ).  /L1 will disable 
  8923.             command-line editing, history recall, filename completion, and the 
  8924.             directory history window, and will reduce the 4OS2 input length 
  8925.             limit from 1023 characters to 255 characters.  It should only be 
  8926.             used if it is needed for compatibility with a specific program.  If 
  8927.             you have a program that requires line input, you can use the 
  8928.             following line in an alias or batch file to change the line input 
  8929.             option just for that single program (change the command separator 
  8930.             to an ampersand [&] for 4OS2): 
  8931.  
  8932.                                 setdos /L1 & program %& & setdos /L0
  8933.  
  8934.             See README.DOC for information on programs which require this 
  8935.             option.  Also see the LineInput directive. 
  8936.  
  8937.     /M:     (Mode) The MODE option controls the initial line editing mode.  To 
  8938.             start in overstrike mode at the beginning of each command line, use 
  8939.             /M0 (the default).  To start in insert mode, use /M1.  Also see the 
  8940.             EditMode directive. 
  8941.  
  8942.     /N:     (No clobber) The NOCLOBBER option controls output redirection). 
  8943.             /N0 means existing files will be overwritten by output redirection 
  8944.             (with >) and that appending (with >>) does not require the file to 
  8945.             exist already.  This is the default.  /N1 means existing files may 
  8946.             not be overwritten by output redirection, and that when appending 
  8947.             the output file must exist.  A /N1 setting can be overridden with 
  8948.             the [!] character.  If you use /N1, you may have problems with a 
  8949.             few unusual programs that shell out to run a command with 
  8950.             redirection, and expect to be able to overwrite an existing file. 
  8951.             Also see the NoClobber directive. 
  8952.  
  8953.     /P:     (Parameter character) This option sets the character used after a 
  8954.             percent sign to specify all or all remaining command-line arguments 
  8955.             in a batch file or alias (e.g., %& or %n&; . The default is the 
  8956.             dollar sign [$]. 
  8957.  
  8958.             If you want to share batch files or aliases between 4DOS and 4OS2 
  8959.             or 4DOS/NT, see 4DOS, 4OS2, and 4DOS/NT Compatibility for details 
  8960.             on selecting compatible parameter characters for all the products 
  8961.             you use.  Also see the ParameterChar directive. 
  8962.  
  8963.     /R:     (Rows) The ROWS option sets the number of screen rows used by the 
  8964.             video display.  Normally 4OS2 detects the screen size, but if you 
  8965.             have a non-standard display you may need to set it explicitly. 
  8966.             This option does not affect screen scrolling (which is controlled 
  8967.             by your video driver).  It is used only for LIST, SELECT, the paged 
  8968.             output options (i.e., TYPE /P), and error checking in the screen 
  8969.             output commands.  Also see the ScreenRows directive. 
  8970.  
  8971.     /S:     (Shape) The SHAPE option sets the cursor shape.  The format is 
  8972.             /So:i where o is the cursor size for overstrike mode, i the cursor 
  8973.             size for insert mode.  The size is entered as a percentage of the 
  8974.             total character height.  The default values are 10:100 (an 
  8975.             underscore cursor for overstrike mode, and a block cursor for 
  8976.             insert mode).  Because of the way video drivers remap the cursor 
  8977.             shape, you may not get a smooth progression in the cursor size from 
  8978.             0% - 100%.  To disable the cursor, enter /S0:0.  Also see the 
  8979.             CursorOver and CursorIns directives. 
  8980.  
  8981.     /U:     (Upper) The UPPER option controls the default case (upper or lower) 
  8982.             for filenames displayed by internal commands like COPY and DIR. 
  8983.             /U0 displays file names in lower case (the default).  /U1 displays 
  8984.             file names in the traditional upper case.  The /U setting is 
  8985.             ignored for HPFS filenames.  HPFS names are always displayed in the 
  8986.             case in which they are stored. Also see the UpperCase directive. 
  8987.  
  8988.     /V:     (Verbose) The VERBOSE option controls the default for command 
  8989.             echoing in batch files.  /V0 disables echoing of batch file 
  8990.             commands unless ECHO is explicitly set ON.  /V1, the default 
  8991.             setting, enables echoing of batch file commands unless ECHO is 
  8992.             explicitly set OFF.  Also see the BatchEcho directive. 
  8993.  
  8994.             /V2 forces echoing of all batch file commands, even if ECHO is set 
  8995.             OFF or the line begins with an "@".  This allows you to turn 
  8996.             echoing on for a batch file without editing the batch file and 
  8997.             removing the ECHO OFF command(s) within it.  /V2 is intended for 
  8998.             debugging, and can be set with SETDOS, but not with the BatchEcho 
  8999.             directive in 4OS2.INI. 
  9000.  
  9001.     /X[+|-]n(expansion and special characters): This option enables and 
  9002.             disables alias and environment variable expansion, and controls 
  9003.             whether special characters have their usual meaning or are treated 
  9004.             as text.  It is most often used in batch files to process text 
  9005.             strings which may contain special characters. 
  9006.  
  9007.             The features enabled or disabled by /X are numbered.  All features 
  9008.             are enabled when 4OS2 starts, and you can re-enable all features at 
  9009.             any time by using /X0.  To disable a particular feature, use /X-n, 
  9010.             where n is the feature number from the list below.  To re-enable 
  9011.             the feature, use /X+n.  To enable or disable multiple individual 
  9012.             features, list their numbers in sequence after the + or - (e.g. /X- 
  9013.             345 to disable features 3, 4, and 5). 
  9014.  
  9015.             The features are: 
  9016.  
  9017.               1  All alias expansion. 
  9018.               2  Nested alias expansion only. 
  9019.               3  All variable expansion (environment variables and batch and 
  9020.             alias parameters) 
  9021.               4  Nested variable expansion only. 
  9022.               5  Multiple commands, conditional commands, and piping 
  9023.               6  Redirection 
  9024.               7  Quoting (double quotes and back quotes) and square brackets 
  9025.               8  Escape character. 
  9026.  
  9027.             If nested alias expansion is disabled, the first alias of a command 
  9028.             is expanded but any aliases it invokes are not expanded.  If nested 
  9029.             variable expansion is disabled, each variable is expanded once, but 
  9030.             variables containing the names of other variables are not expanded 
  9031.             further. 
  9032.  
  9033.             For example, to disable all features except alias expansion while 
  9034.             you are processing a text file containing special characters: 
  9035.  
  9036.                                 setdos /x-35678
  9037.                                 ... [perform text processing here]
  9038.                                 setdos /x0
  9039.  
  9040.     /Y:     (Single step) /Y1 enables single-stepping through a batch file. 
  9041.             Each command is displayed on the screen along with a Y/N/R (yes / 
  9042.             no / remainder) prompt.  Press Y to execute the command, N to omit 
  9043.             the command and go on to the next, or R to execute the remainder of 
  9044.             the batch file (up to the next SETDOS /Y1 command).  You may also 
  9045.             press Ctrl-C or Ctrl-Break toterminate the batch file. 
  9046.  
  9047.             Batch file single stepping is disabled each time 4OS2 returns to 
  9048.             the command prompt. This means you cannot enter the SETDOS /Y1 
  9049.             command at the prompt, press Enter, and start a batch file in 
  9050.             single step mode at the next prompt.  However you can enable single 
  9051.             step operation and run a batch file from the prompt if you enter 
  9052.             both commands on one line. For example, this command runs 
  9053.             FILECOMP.CMD with single step enabled: 
  9054.  
  9055.                                 [c:\] setdos /y1 & filecomp.cmd
  9056.  
  9057.  
  9058. ΓòÉΓòÉΓòÉ 14.67. SETLOCAL - Save the environment ΓòÉΓòÉΓòÉ
  9059.  
  9060.  Purpose:    Save a copy of the current disk drive, directory, environment, and 
  9061.              alias list. 
  9062.  
  9063.  Format:     SETLOCAL 
  9064.  
  9065.  See also:  ENDLOCAL. 
  9066.  
  9067.  Usage 
  9068.  
  9069.  SETLOCAL is used in batch files to save the default disk drive and directory, 
  9070.  the environment, and the alias list to a reserved block of memory.  You can 
  9071.  then change their values and later restore the original values with the 
  9072.  ENDLOCAL command. 
  9073.  
  9074.  For example, this batch file fragment saves everything, removes all aliases so 
  9075.  that user aliases will not affect batch file commands, changes the disk and 
  9076.  directory, modifies a variable, runs a program, and then restores the original 
  9077.  values: 
  9078.  
  9079.           setlocal
  9080.           unalias *
  9081.           cdd d:\test
  9082.           set path=c:\;c:\dos;c:\util
  9083.           rem run some program here
  9084.           endlocal
  9085.  
  9086.  SETLOCAL and ENDLOCAL are not nestable within a batch file. However, you can 
  9087.  have multiple SETLOCAL / ENDLOCAL pairs within a batch file, and nested batch 
  9088.  files can each have their own SETLOCAL / ENDLOCAL.  You cannot use SETLOCAL in 
  9089.  an alias or at the command line. 
  9090.  
  9091.  An ENDLOCAL is performed automatically at the end of a batch file if you 
  9092.  forget to do so.  If you invoke one batch file from another without using 
  9093.  CALL, the first batch file is terminated, and an automatic ENDLOCAL is 
  9094.  performed.  The second batch file inherits the drive, directory, aliases, and 
  9095.  environment variables as they were prior to any unterminated SETLOCAL. 
  9096.  
  9097.  
  9098. ΓòÉΓòÉΓòÉ 14.68. SHIFT - Shift batch file parameters ΓòÉΓòÉΓòÉ
  9099.  
  9100.  Purpose:    Allows the use of more than 127 parameters in a batch file. 
  9101.  
  9102.  Format:     SHIFT [n ] 
  9103.  
  9104.              n :  Number of positions to shift. 
  9105.  
  9106.  Usage 
  9107.  
  9108.  SHIFT is provided for compatibility with older batch files, where it was used 
  9109.  to access more than 10 parameters.  4OS2 supports 128 parameters (%0 to %127), 
  9110.  so you may not need to use SHIFT for batch files running exclusively under JP 
  9111.  Software command processors. 
  9112.  
  9113.  SHIFT moves each of the batch file parameters n positions to the left.  The 
  9114.  default value for n is 1.  SHIFT 1 moves the parameter in %1 to position %0, 
  9115.  the parameter in %2 becomes %1, etc.  You can reverse a SHIFT by giving a 
  9116.  negative value for n (i.e., after SHIFT -1, the former %0 is restored, %0 
  9117.  becomes %1, %1 becomes %2, etc.). 
  9118.  
  9119.  SHIFT also affects the parameters %n$. (command-line tail) and %# (number of 
  9120.  command arguments). 
  9121.  
  9122.  
  9123. ΓòÉΓòÉΓòÉ 14.69. START - Start a program in another session ΓòÉΓòÉΓòÉ
  9124.  
  9125.  Purpose:    Start a program in another session or window. 
  9126.  
  9127.  Format:     START ["program title "] [/B[G] /C /DOS[=optfile ] /F[G] /FS /I 
  9128.              /ICON=iconfile /INV /K /L /LA /LH /MAX /MIN /N /PGM progname /PM 
  9129.              /POS=row,col,width,height /WAIT /WIN /WIN3[=optfile ] 
  9130.              /WIN3S[=optfile ]] [command ] 
  9131.  
  9132.              program title :  Title to appear on title bar. 
  9133.              optfile :  Option settings file. 
  9134.              iconfile :  Name of icon (.ICO ) file. 
  9135.              progname :  Program name (not the session name). 
  9136.              path :  Startup directory. 
  9137.              command :  Command to be executed. 
  9138.  
  9139.              /B[G] (background session)      /LH (local history list) 
  9140.              /C(lose when done)              /MAX(imized) 
  9141.              /DOS (DOS session)              /MIN(imized) 
  9142.              /F[G] (foreground session)      /N(o 4OS2.EXE ) 
  9143.              /FS (full screen)               /PGM (program name) 
  9144.              /I(nherit environment)          /PM (PM application) 
  9145.              /ICON (.ICO file)               /POS(ition of window) 
  9146.              /INV(isible)                    /WAIT (for session to finish) 
  9147.              /K(eep when done)               /WIN(dowed session) 
  9148.              /L(ocal lists)                  /WIN3 (Windows enhanced mode) 
  9149.              /LA (local aliases)             /WIN3S (Windows standard mode) 
  9150.  
  9151.  See also:  DETACH. 
  9152.  
  9153.  Usage 
  9154.  
  9155.  START is used to begin a new OS/2 session, and optionally run a program in 
  9156.  that session.  If you use START with no parameters, it will begin a new 
  9157.  command-line session.  If you add a command, START will begin a new session or 
  9158.  window and execute that command. 
  9159.  
  9160.  The program title, if it is included, will appear on the title bar, and on the 
  9161.  Presentation Manager task list (OS/2 version 1.x) or window list (OS/2 version 
  9162.  2.x).  The program title must be enclosed in quotation marks and cannot exceed 
  9163.  60 characters.  If the program title is omitted, the program name will be used 
  9164.  as the title. 
  9165.  
  9166.  START offers a large number of switches to control the session you start.  In 
  9167.  most cases you need only a few switches to accomplish what you want.  The list 
  9168.  below summarizes the most commonly used START options, and how you can use 
  9169.  them to control the way a session is started: 
  9170.  
  9171.         /MAX, /MIN, and /POS allow you to start a character-mode windowed 
  9172.         session in a maximized window, a minimized window, or a window with a 
  9173.         specified position and size.  The default is to let the operating 
  9174.         environment choose the position and size of the window. 
  9175.  
  9176.         /C allows you to close the session when the command is finished (the 
  9177.         default for DOS and OS/2 Presentation Manager sessions); /K allows you 
  9178.         to keep the session open and go to a prompt (the default for OS/2 
  9179.         character mode sessions). 
  9180.  
  9181.         /BG and /FG allow you to start the session in the background(does not 
  9182.         respond to keystrokes until selected) or foreground (responds to 
  9183.         keystrokes until deselected).  /FG is the default if /DOS, /FS, /WIN, 
  9184.         or /PM is used; otherwise, /BG is the default. 
  9185.  
  9186.         /FS and /WIN control whether a character-mode session is started in 
  9187.         full-screen or windowed mode.  The default is to start a session of the 
  9188.         same type as the current session, if the application can be run in such 
  9189.         a session. 
  9190.  
  9191.  START determines the application type automatically and starts the session in 
  9192.  the appropriate mode:  OS/2, Windows, DOS, full-screen, windowed, or 
  9193.  Presentation Manager. 
  9194.  
  9195.  START gives you some flexibility in determining the session mode. For example, 
  9196.  if the command is the name of a batch file (either a .BTM or .CMD file), you 
  9197.  can use the /FS or /WIN options to run the batch file as part of a new 4OS2 
  9198.  session in either full-screen or windowed mode. 
  9199.  
  9200.  However, you cannot start a session in a mode that is inappropriate for the 
  9201.  application type.  A DOS application cannot be run as part of a Presentation 
  9202.  Manager session, for example, even if you use the /PM switch.  Invalid or 
  9203.  conflicting options will be ignored. 4OS2 will always attempt to run the 
  9204.  command in the appropriate type of session. 
  9205.  
  9206.  If the program is a DOS application or .BAT file, 4OS2 will return an error 
  9207.  message in OS/2 version 1.x.  In OS/2 version 2.x, 4OS2 will start a new DOS 
  9208.  session to run the program or batch file. The DOS session will close itself 
  9209.  automatically as soon as the program or batch file ends, unless /K is used. 
  9210.  If you want the session to wait for a keystroke before it closes itself, you 
  9211.  can use the syntax: 
  9212.  
  9213.           [c:\] start /DOS command ^^ pause
  9214.  
  9215.  (Because the caret [^] is the default 4OS2 escape character, two carets must 
  9216.  be used in order to pass one on to 4DOS as a command separator.) 
  9217.  
  9218.  If you want to start a DOS command-line session in OS/2 version 2.x, you can 
  9219.  use the command: 
  9220.  
  9221.           [c:\] start /DOS
  9222.  
  9223.  You can specify settings for DOS and Windows sessions by using a settings 
  9224.  options file, and loading it with the /DOS=, /WIN3=, or /WIN3S= option.  This 
  9225.  allows you to start DOS and Windows sessions with specific settings without 
  9226.  creating a desktop object and modifying the settings manually.  Before using 
  9227.  this capability you should read the description of it under /DOS= (below) very 
  9228.  carefully, since errors in the settings file can occasionally hang your 
  9229.  system. 
  9230.  
  9231.  Options 
  9232.  
  9233.     /BG:        (BackGround session) The session is started as a background 
  9234.                 session.  /BG may be abbreviated to /B. 
  9235.  
  9236.     /C:         (Close) The session or window is closed when the application 
  9237.                 ends. 
  9238.  
  9239.     /DOS[=filename]:(DOS session) Start a DOS session under OS/2 version 2.x. 
  9240.                 This option is not available in OS/2 version 1.x, which doesn't 
  9241.                 allow multiple DOS sessions. 
  9242.  
  9243.                 If you include the =filename, OS/2 will load DOS settings from 
  9244.                 the specified file.  This option is available only in the 
  9245.                 32-bit version of 4OS2. 
  9246.  
  9247.                 Starting a session with specific DOS settings is an 
  9248.                 undocumented feature which was implemented within OS/2 with 
  9249.                 little error checking.  It is included in START because it 
  9250.                 substantially eases a complex task, but you must experiment 
  9251.                 carefully to ensure that the settings you select will work 
  9252.                 properly on the systems on which you plan to use them. 
  9253.                 Incorrect settings may be ignored, but they may also hang your 
  9254.                 session or stop the entire system.  Be sure your experiments 
  9255.                 are not conducted while critical tasks are in process. 
  9256.  
  9257.                 Each line in the file must have a name, an equal sign [=], and 
  9258.                 a value.  The names are those shown in OS/2's DOS Settings 
  9259.                 dialog box.  Do not use spaces on either side of the equal 
  9260.                 sign. 
  9261.  
  9262.                 The names in the DOS Settings dialog box will vary depending on 
  9263.                 the device drivers and other settings in your CONFIG.SYS file, 
  9264.                 though many are available on all systems.  You must ensure that 
  9265.                 the names you use are valid for the systems on which you use 
  9266.                 them.  For example, if you replace IBM's COM.SYS and VCOM.SYS 
  9267.                 with different communications drivers, the COM_ settings will 
  9268.                 probably not be valid for the new drivers.  If you have a 
  9269.                 settings file which contains settings defined by a particular 
  9270.                 driver, and use it on a system where the corresponding driver 
  9271.                 is not loaded, the results are undefined. 
  9272.  
  9273.                 The values in your settings file must be numeric for settings 
  9274.                 which show a numeric value under DOS Settings (e.g., 
  9275.                 DOS_FILES=30), and must be text strings for settings shown with 
  9276.                 a string (e.g., DOS_SHELL=C:\4DOS.COM C:\4DOS /P).  Strings 
  9277.                 should be entered without trailing blanks.  For values shown as 
  9278.                 multiple choice on the DOS Settings page you must specify a 
  9279.                 numeric value, typically "0" for Off and 1 for On (e.g., 
  9280.                 DOS_HIGH=1).  Items with choices other than Off and On may use 
  9281.                 different values, or may not work at all; experimentation is 
  9282.                 usually required to find out what works.  Attempting to use 
  9283.                 strings for choice items (e.g., DOS_HIGH=ON) will not work, and 
  9284.                 can hang your system.  This is due to the internal operation of 
  9285.                 OS/2, and is not a problem in 4OS2. 
  9286.  
  9287.                 A typical DOS settings file might look like this: 
  9288.  
  9289.                                         DOS_FILES=30
  9290.                                         DOS_HIGH=1
  9291.                                         DOS_SHELL=C:\4DOS\4DOS.COM C:\4DOS /P
  9292.                                         MOUSE_EXCLUSIVE_ACCESS=0
  9293.                                         VIDEO_FASTPASTE=1
  9294.  
  9295.                 You can include comments in a settings file by beginning any 
  9296.                 line with a colon [:]. 
  9297.  
  9298.     /FG:        (ForeGround session) Start the session as the foreground 
  9299.                 session.  /FG may be abbreviated to /F. 
  9300.  
  9301.     /FS:        (Full Screen) Start the session as a full-screen session. 
  9302.  
  9303.     /I:         (Inherit environment) Inherit the default environment specified 
  9304.                 in CONFIG.SYS, if any, rather than the current environment. 
  9305.  
  9306.     /ICON=filename:Use the specified icon file.  If you don't use /ICON, 4OS2 
  9307.                 will look for an .ICO file with the same file name and in the 
  9308.                 same directory as the program file.  Some versions of OS/2 may 
  9309.                 ignore this option and use the default icon for the session. 
  9310.                 If you encounter this problem, check whether an update to OS/2 
  9311.                 has been released which addresses it. 
  9312.  
  9313.     /INV:       (Invisible) Start the session or window as invisible.  No icon 
  9314.                 will appear and the session will only be accessible through the 
  9315.                 Task Manager or Window List. 
  9316.  
  9317.     /K:         (Keep session or window at end) The session or window continues 
  9318.                 after the application program ends.  Use the EXIT command to 
  9319.                 end the session. 
  9320.  
  9321.     /L:         (Local lists) Start 4OS2 with local alias and history lists. 
  9322.                 This option combines the effects of /LA and /LH (below). 
  9323.  
  9324.     /LA:        (Local Alias list) Start 4OS2 with a local alias list.See ALIAS 
  9325.                 for information on local and global aliases. 
  9326.  
  9327.     /LH:        (Local History list) Start 4OS2 with a local history list. See 
  9328.                 Command History and Recall for information on local and global 
  9329.                 history lists. 
  9330.  
  9331.     /MAX:       (Maximized) Start the session or window maximized. 
  9332.  
  9333.     /MIN:       (Minimized) Start the session or window minimized. 
  9334.  
  9335.     /N:         Under 4OS2, start an OS/2 program directly, without a command 
  9336.                 processor.  The command cannot be an internal command or batch 
  9337.                 file. This is the default for PM applications. 
  9338.  
  9339.     /PGM:       (Program name) The string following this option is the program 
  9340.                 name.  The first quoted string on the line will be used as the 
  9341.                 session and task list title, and not as the program name. 
  9342.  
  9343.     /PM:        (Presentation Manager) Start a program in the PM session. 
  9344.  
  9345.     /POS:       (Position) Start the window at the specified screen position. 
  9346.                 The syntax is /POS=row, col, width, height where the values are 
  9347.                 specified in pixels or pels.  Row and col refer to the position 
  9348.                 of the bottom left corner of the window relative to the bottom 
  9349.                 left corner of the screen. 
  9350.  
  9351.     /WAIT:      Wait for the new session or window to finish before continuing. 
  9352.                 Cannot be used with /WIN3 or /WIN3S. 
  9353.  
  9354.     /WIN:       (Windowed) Start the session in a window. 
  9355.  
  9356.     /WIN3[=filename]:(Windows enhanced mode) Run the program in an 
  9357.                 enhanced-mode Windows 3.x session.  The session will run 
  9358.                 seamless (on the OS/2 desktop).  To start a Windows application 
  9359.                 in full-screen mode, use /FS rather than /WIN3.  You can 
  9360.                 include an equal sign and the name of an options file to set 
  9361.                 options for the specific session and application (see /DOS= 
  9362.                 above for details).  The setting names in the file should be 
  9363.                 taken from those shown in OS/2's WIN-OS/2 Settings dialog box. 
  9364.                 Available only in the 32-bit version of 4OS2. 
  9365.  
  9366.     /WIN3S[=filename]:(Windows standard mode) Equivalent to /WIN3, but runs the 
  9367.                 program in standard mode rather than enhanced mode. Available 
  9368.                 only in 4OS2/32. 
  9369.  
  9370.  
  9371. ΓòÉΓòÉΓòÉ 14.70. TEE - "Tee" pipe fitting ΓòÉΓòÉΓòÉ
  9372.  
  9373.  Purpose:    Copy standard input to both standard output and a file. 
  9374.  
  9375.  Format:     TEE [/A] file... 
  9376.  
  9377.              file :  One or more files that will receive the "tee-d" output. 
  9378.  
  9379.              /A(ppend) 
  9380.  
  9381.  See also:  Y and the redirection options. 
  9382.  
  9383.  Usage 
  9384.  
  9385.  TEE is normally used to "split" the output of a program so that you can see it 
  9386.  on the display and also save it in a file.  It can also be used to capture 
  9387.  intermediate output before the data is altered by another program or command. 
  9388.  
  9389.  TEE gets its input from standard input (usually the piped output of another 
  9390.  command or program), and sends out two copies:  one goes to standard output, 
  9391.  the other to the file or files that you specify.  TEE is not likely to be 
  9392.  useful with programs which do not use standard output, because these programs 
  9393.  cannot send output through a pipe. 
  9394.  
  9395.  For example, to search the file DOC for any lines containing the string 
  9396.  "4OS2", make a copy of the matching lines in 4.DAT, sort the lines, and write 
  9397.  them to the output file 4O.DAT : 
  9398.  
  9399.           [c:\] find "4OS2" doc | tee 4.dat | sort > 4o.dat
  9400.  
  9401.  If you are typing at the keyboard to produce the input for TEE, you must enter 
  9402.  a Ctrl-Z to terminate the input. 
  9403.  
  9404.  When using TEE with a pipe under 4OS2, the programs on the two ends of the 
  9405.  pipe run simultaneously, not sequentially as in 4DOS. 
  9406.  
  9407.  See Piping for more information on pipes. 
  9408.  
  9409.  Option 
  9410.  
  9411.     /A:     (Append) Append the output to the file(s) rather than overwriting 
  9412.             them. 
  9413.  
  9414.  
  9415. ΓòÉΓòÉΓòÉ 14.71. TEXT - Display text in a batch file ΓòÉΓòÉΓòÉ
  9416.  
  9417.  Purpose:    Display a block of text in a batch file. 
  9418.  
  9419.  Format:     TEXT 
  9420.                 . 
  9421.                 . 
  9422.                 . 
  9423.              ENDTEXT 
  9424.  
  9425.  See also:  ECHO, SCREEN, SCRPUT, and VSCRPUT. 
  9426.  
  9427.  Usage 
  9428.  
  9429.  TEXT can only be used in batch files. 
  9430.  
  9431.  The TEXT command is useful for displaying menus or multi-line messages.  TEXT 
  9432.  will display all subsequent lines in the batch file until terminated by 
  9433.  ENDTEXT.  Both TEXT and ENDTEXT must be entered as the only command on the 
  9434.  line. 
  9435.  
  9436.  To redirect the entire block of text, use redirection on the TEXT command 
  9437.  itself, but not on the actual text lines or the ENDTEXT line.  No environment 
  9438.  variable expansion or other processing is performed on the lines between TEXT 
  9439.  and ENDTEXT; they are displayed exactly as they are stored in the batch file. 
  9440.  
  9441.  You can change screen colors by inserting ANSI escape sequences anywhere in 
  9442.  the text block.  You can also use a CLS or COLOR command to set the screen 
  9443.  color before executing the TEXT command. 
  9444.  
  9445.  The following batch file fragment displays a simple menu: 
  9446.  
  9447.           @echo off & cls
  9448.           screen 2 0
  9449.           text
  9450.           Enter one of the following:
  9451.              1 - Spreadsheet
  9452.              2 - Word Processing
  9453.              3 - Utilities
  9454.           endtext
  9455.  
  9456.  
  9457. ΓòÉΓòÉΓòÉ 14.72. TIME - Set the system time ΓòÉΓòÉΓòÉ
  9458.  
  9459.  Purpose:    Display or set the current system time. 
  9460.  
  9461.  Format:     TIME [hh [:mm [:ss ]]] [AM | PM] 
  9462.  
  9463.              hh :  The hour (0 - 23). 
  9464.              mm :  The minute (0 - 59). 
  9465.              ss :  The second (0 - 59). 
  9466.  
  9467.  See also:  CHCP and DATE. 
  9468.  
  9469.  Usage 
  9470.  
  9471.  If you don't enter any parameters, TIME will display the current system time 
  9472.  and prompt you for a new time.  Press Enter if you don't wish to change the 
  9473.  time; otherwise, enter the new time: 
  9474.  
  9475.           [c:\] time
  9476.           Wed  Dec 22, 1993  9:30:10
  9477.           New time (hh:mm:ss):
  9478.  
  9479.  TIME defaults to 24-hour format, but you can optionally enter the time in 
  9480.  12-hour format by appending "a", "am", "p", or "pm" to the time you enter. 
  9481.  
  9482.  For example, to enter the time as 9:30 am: 
  9483.  
  9484.           [c:\] time 9:30 am
  9485.  
  9486.  OS/2 adds the system time and date to the directory entry for every file you 
  9487.  create or modify.  If you keep both the time and date accurate, you will have 
  9488.  a record of when you last updated each file. 
  9489.  
  9490.  
  9491. ΓòÉΓòÉΓòÉ 14.73. TIMER - Start or stop a stopwatch ΓòÉΓòÉΓòÉ
  9492.  
  9493.  Purpose:    TIMER is a system stopwatch. 
  9494.  
  9495.  Format:     TIMER [ON] [/1 /2 /3 /S] 
  9496.  
  9497.              ON:  Force the stopwatch to restart 
  9498.  
  9499.              /1 (stopwatch #1)               /3 (stopwatch #3) 
  9500.              /2 (stopwatch #2)               /S(plit) 
  9501.  
  9502.  Usage 
  9503.  
  9504.  The TIMER command turns a system stopwatch on and off.  When you first run 
  9505.  TIMER, the stopwatch starts: 
  9506.  
  9507.           [c:\] timer
  9508.           Timer 1 on:  12:21:46
  9509.  
  9510.  When you run TIMER again, the stopwatch stops and the elapsed time is 
  9511.  displayed: 
  9512.  
  9513.           [c:\] timer
  9514.           Timer 1 off:  12:21:58   Elapsed time: 0:00:12.06
  9515.  
  9516.  There are three stopwatches available (1, 2, and 3) so you can time multiple 
  9517.  overlapping events.  By default, TIMER uses stopwatch #1. 
  9518.  
  9519.  The smallest interval TIMER can measure depends on the operating system you 
  9520.  are using, your hardware, and the interaction between the two.  However, it 
  9521.  should never be greater than .06 second.  The largest interval is 23 hours, 59 
  9522.  minutes, 59.99 seconds. 
  9523.  
  9524.  Options 
  9525.  
  9526.     /1:     Use timer #1 (the default). 
  9527.  
  9528.     /2:     Use timer #2. 
  9529.  
  9530.     /3:     Use timer #3. 
  9531.  
  9532.     /S:     (Split) Display a split time without stopping the timer.  To 
  9533.             display the current elapsed time but leave the timer running: 
  9534.  
  9535.                                 [c:\] timer /s
  9536.                                 Timer 1 elapsed: 0:06:40.63
  9537.  
  9538.     ON:     Start the timer regardless of its previous state (on or off). 
  9539.             Otherwise the TIMER command toggles the timer state (unless /S is 
  9540.             used). 
  9541.  
  9542.  
  9543. ΓòÉΓòÉΓòÉ 14.74. TYPE - Display file(s) ΓòÉΓòÉΓòÉ
  9544.  
  9545.  Purpose:    Display the contents of the specified file(s). 
  9546.  
  9547.  Format:     TYPE [/L /P] file... 
  9548.  
  9549.              file :  The file or list of files that you want to display. 
  9550.  
  9551.              /L(ine numbers)                 /P(ause) 
  9552.  
  9553.  See also:  LIST. 
  9554.  
  9555.  File Selection 
  9556.  
  9557.  Supports extended wildcards, ranges, multiple file names, and include lists. 
  9558.  
  9559.  Usage 
  9560.  
  9561.  The TYPE command displays a file.  It is normally only useful for displaying 
  9562.  ASCII text files.  Executable files (.COM and .EXE ) and many data files may 
  9563.  be unreadable when displayed with TYPE because they include non-alphanumeric 
  9564.  characters. 
  9565.  
  9566.  To display the files MEMO1 and MEMO2 : 
  9567.  
  9568.           [c:\] type /p memo1 memo2
  9569.  
  9570.  You can press Ctrl-S to pause TYPE's display and then any key to continue. 
  9571.  
  9572.  You will probably find LIST to be more useful for displaying files. However, 
  9573.  the TYPE /L command used with redirection is useful if you want to add line 
  9574.  numbers to a file. 
  9575.  
  9576.  Options 
  9577.  
  9578.     /L:     (Line numbers) Display a line number preceding each line of text. 
  9579.  
  9580.     /P:     (Pause) Prompt after displaying each page.  Your options at the 
  9581.             prompt are explained in detail under Page and File Prompts. 
  9582.  
  9583.  
  9584. ΓòÉΓòÉΓòÉ 14.75. UNALIAS - Remove aliases ΓòÉΓòÉΓòÉ
  9585.  
  9586.  Purpose:    Remove aliases from the alias list. 
  9587.  
  9588.  Format:     UNALIAS [/Q] alias... 
  9589.                 or 
  9590.              UNALIAS * 
  9591.  
  9592.              alias :  One or more aliases to remove from memory. 
  9593.  
  9594.              /Q(uiet) 
  9595.  
  9596.  See also:  ALIAS and ESET. 
  9597.  
  9598.  Usage 
  9599.  
  9600.  4OS2 maintains a list of the aliases that you have defined.  The UNALIAS 
  9601.  command will remove aliases from that list.  You can remove one or more 
  9602.  aliases by name, or you can delete the entire alias list by using the command 
  9603.  UNALIAS *. 
  9604.  
  9605.  For example, to remove the alias DDIR: 
  9606.  
  9607.           [c:\] unalias ddir
  9608.  
  9609.  To remove all the aliases: 
  9610.  
  9611.           [c:\] unalias *
  9612.  
  9613.  Options 
  9614.  
  9615.     /Q:     (Quiet) Prevents UNALIAS from displaying an error message if one or 
  9616.             more of the aliases does not exist.  This option is most useful in 
  9617.             batch files, for removing a group of aliases when some of the 
  9618.             aliases may not have been defined. 
  9619.  
  9620.  
  9621. ΓòÉΓòÉΓòÉ 14.76. UNSET - Remove environment variables ΓòÉΓòÉΓòÉ
  9622.  
  9623.  Purpose:    Remove variables from the environment. 
  9624.  
  9625.  Format:     UNSET  [/Q] name... 
  9626.                 or 
  9627.              UNSET * 
  9628.  
  9629.              name :  One or more variables to remove from the environment. 
  9630.  
  9631.              /Q(uiet) 
  9632.  
  9633.  See also:  ESET and SET. 
  9634.  
  9635.  Usage 
  9636.  
  9637.  UNSET removes one or more variables from the environment.  For example, to 
  9638.  remove the variable CMDLINE: 
  9639.  
  9640.           [c:\] unset cmdline
  9641.  
  9642.  If you use the command UNSET *, all of the environment variables will be 
  9643.  deleted: 
  9644.  
  9645.           [c:\] unset *
  9646.  
  9647.  UNSET is often used in conjunction with the SETLOCAL and ENDLOCAL commands in 
  9648.  order to clear the environment of variables that may cause problems for some 
  9649.  applications. 
  9650.  
  9651.  For more information on environment variables, see the SET command and the 
  9652.  general discussion of the environment. 
  9653.  
  9654.  Use caution when removing environment variables, and especially when using 
  9655.  UNSET *.  Many programs will not work properly without certain environment 
  9656.  variables; for example, 4OS2 uses PATH and DPATH. 
  9657.  
  9658.  Options 
  9659.  
  9660.     /Q:     (Quiet) Prevents UNSET from displaying an error message if one or 
  9661.             more of the variables does not exist.  This option is most useful 
  9662.             in batch files, for removing a group of variables when some of the 
  9663.             variables may not have been defined. 
  9664.  
  9665.  
  9666. ΓòÉΓòÉΓòÉ 14.77. VER - Display the 4OS2 and OS/2 version ΓòÉΓòÉΓòÉ
  9667.  
  9668.  Purpose:    Display the current command processor and operating system 
  9669.              versions. 
  9670.  
  9671.  Format:     VER [/R] 
  9672.  
  9673.              /R(evision level) 
  9674.  
  9675.  Usage 
  9676.  
  9677.  Version numbers consist of a one-digit major version number, a period, and a 
  9678.  one- or two-digit minor version number.  The VER command displays both version 
  9679.  numbers: 
  9680.  
  9681.           [c:\] ver
  9682.  
  9683.           4OS2/32 2.0   OS/2 Version is 2.1
  9684.  
  9685.  Option 
  9686.  
  9687.     /R:     (Revision level) Display the 4OS2 and OS/2 internal revision levels 
  9688.             (if any), plus your 4OS2 serial number and registered name. 
  9689.  
  9690.  
  9691. ΓòÉΓòÉΓòÉ 14.78. VERIFY - Enable or disable disk write verification ΓòÉΓòÉΓòÉ
  9692.  
  9693.  Purpose:    Enable or disable disk write verification or display the 
  9694.              verification state. 
  9695.  
  9696.  Format:     VERIFY [ON | OFF] 
  9697.  
  9698.  Usage 
  9699.  
  9700.  OS/2 maintains an internal verify flag.  When the flag is on, OS/2 attempts to 
  9701.  verify each disk write by making sure that the data written to the disk can be 
  9702.  read back successfully into the computer.  It does not compare the data 
  9703.  written with the data actually placed on disk. 
  9704.  
  9705.  If used without any parameters, VERIFY will display the state of the verify 
  9706.  flag: 
  9707.  
  9708.           [c:\] verify
  9709.           VERIFY is OFF
  9710.  
  9711.  VERIFY is off when the system boots up.  Once it is turned on with the VERIFY 
  9712.  ON command, it stays on until you use the VERIFY OFF command or until you 
  9713.  reboot. 
  9714.  
  9715.  Verification will slow your disk write operations slightly (the effect is not 
  9716.  usually noticeable). 
  9717.  
  9718.  
  9719. ΓòÉΓòÉΓòÉ 14.79. VOL - Display disk volume labels ΓòÉΓòÉΓòÉ
  9720.  
  9721.  Purpose:    Display disk volume label(s). 
  9722.  
  9723.  Format:     VOL [d :] ... 
  9724.  
  9725.              d:  The drive or drives to search for labels. 
  9726.  
  9727.  Usage 
  9728.  
  9729.  Each disk may have a volume label, created when the disk is formatted or with 
  9730.  the external LABEL command.  Also, every floppy disk formatted with DOS 
  9731.  version 4.0 or above, OS/2, or Windows NT has a volume serial number. 
  9732.  
  9733.  The VOL command will display the volume label and, if available, the volume 
  9734.  serial number of a disk volume.  If the disk doesn't have a volume label, VOL 
  9735.  will report that it is "unlabeled."  If you don't specify a drive, VOL 
  9736.  displays information about the current drive: 
  9737.  
  9738.           [c:\] vol
  9739.           Volume in drive C: is MYHARDDISK
  9740.  
  9741.  If available, the volume serial number will appear after the drive label or 
  9742.  name. 
  9743.  
  9744.  To display the disk labels for drives A and B: 
  9745.  
  9746.           [c:\] vol a: b:
  9747.           Volume in drive A: is unlabeled
  9748.           Volume in drive B: is BACKUP_2
  9749.  
  9750.  
  9751. ΓòÉΓòÉΓòÉ 14.80. VSCRPUT - Display text vertically and in color ΓòÉΓòÉΓòÉ
  9752.  
  9753.  Purpose:    Display text vertically in the specified color. 
  9754.  
  9755.  Format:     VSCRPUT  row col [BRIght] [BLInk] fg ON [BRIght] bg text 
  9756.  
  9757.              row :  Starting row number. 
  9758.              col :  Starting column number. 
  9759.              fg :  Foreground text color. 
  9760.              bg :  Background text color. 
  9761.              text :  The text to display. 
  9762.  
  9763.  See also:  SCRPUT. 
  9764.  
  9765.  Usage 
  9766.  
  9767.  VSCRPUT writes text vertically on the screen rather than horizontally.  Like 
  9768.  the SCRPUT command, it uses the colors you specify to write the text.  VSCRPUT 
  9769.  can be used for simple graphs and charts generated by batch files.  It always 
  9770.  leaves the cursor in its current position.  See Colors and Color Names for 
  9771.  details about colors and notes on the use of bright background colors. 
  9772.  
  9773.  The row and column are zero-based, so on a standard 25 line by 80 column 
  9774.  display, valid rows are 0 - 24 and valid columns are 0 - 79.  You can also 
  9775.  specify the row and column as offsets from the current cursor position.  Begin 
  9776.  the value with a plus sign [+] to move down the specified number of rows or to 
  9777.  the right the specified number of columns before displaying text, or with a 
  9778.  minus sign [-] to move up or to the left. 
  9779.  
  9780.  VSCRPUT checks for a valid row and column, and displays a "Usage" error 
  9781.  message if either value is out of range. 
  9782.  
  9783.  
  9784. ΓòÉΓòÉΓòÉ 14.81. WINDOW - Change the window state or title ΓòÉΓòÉΓòÉ
  9785.  
  9786.  Purpose:    Minimize or maximize the current window, restore the default 
  9787.              window size, or change the window title. 
  9788.  
  9789.  Format:     WINDOW [MIN | MAX | RESTORE] [/POS=row,col,width, height] ["title 
  9790.              "] 
  9791.  
  9792.              title :  A new title for the window. 
  9793.  
  9794.              /POS(ition) 
  9795.  
  9796.  Usage 
  9797.  
  9798.  WINDOW is used to control the appearance and title of the current window. 
  9799.  WINDOW MIN reduces the window to an icon, WINDOW MAX enlarges it to its 
  9800.  maximum size, and WINDOW RESTORE returns the window to its default size and 
  9801.  location on the desktop. 
  9802.  
  9803.  You can use the /POS option to set the location and size of the window on the 
  9804.  desktop.  The row and column values of the /POS option select the window's 
  9805.  origin while the width and height values determine its size. 
  9806.  
  9807.  If you specify a new title, the title text must be enclosed in double quotes. 
  9808.  The quotes will not appear as part of the actual title. 
  9809.  
  9810.  Option 
  9811.  
  9812.     /POS(ition):Set the window screen position and size.  The syntax is 
  9813.             /POS=row, col, width, height where the values are specified in 
  9814.             pixels or pels.  Row and col refer to the position of the bottom 
  9815.             left corner of the window relative to the bottom left corner of the 
  9816.             screen. 
  9817.  
  9818.  
  9819. ΓòÉΓòÉΓòÉ 14.82. Y - "Y" pipe fitting ΓòÉΓòÉΓòÉ
  9820.  
  9821.  Purpose:    Copy standard input to standard output, and then copy the 
  9822.              specified file(s) to standard output. 
  9823.  
  9824.  Format:     Y file ... 
  9825.  
  9826.              file :  The file or list of files to send to standard output. 
  9827.  
  9828.  See also:  TEE. 
  9829.  
  9830.  Usage 
  9831.  
  9832.  The Y command copies input from standard input (usually the keyboard) to 
  9833.  standard output (usually the screen).  Once the input ends, the named files 
  9834.  are appended to standard output. 
  9835.  
  9836.  For example, to get text from standard input, append the files MEMO1 and MEMO2 
  9837.  to it, and send the output to MEMOS : 
  9838.  
  9839.           [c:\] y memo1 memo2 > memos
  9840.  
  9841.  The Y command is most useful if you want to add redirected data to the 
  9842.  beginning of a file instead of appending it to the end.  For example, this 
  9843.  command copies the output of DIR, followed by the contents of  the file 
  9844.  DIREND, to the file DIRALL: 
  9845.  
  9846.           [c:\] dir | y dirend > dirall
  9847.  
  9848.  If you are typing at the keyboard to produce input text for Y, you must enter 
  9849.  a Ctrl-Z to terminate the input. 
  9850.  
  9851.  When using Y with a pipe you must take into account that the programs on the 
  9852.  two ends of the pipe run simultaneously, not sequentially. 
  9853.  
  9854.  See Piping for more information on pipes. 
  9855.  
  9856.  
  9857. ΓòÉΓòÉΓòÉ 15. Error Messages ΓòÉΓòÉΓòÉ
  9858.  
  9859. This section lists error messages generated by 4OS2, and includes a recommended 
  9860. course of action for most errors.  If you are unable to resolve the problem, 
  9861. look through your Introduction and Installation Guide for any additional 
  9862. troubleshooting recommendations, then contact JP Software for technical 
  9863. support. 
  9864.  
  9865. Error messages relating to files are generally reports of errors returned by 
  9866. OS/2.  You may find some of these messages (for example, "Access denied") vague 
  9867. enough that they are not always helpful.  4OS2 includes the file name in file 
  9868. error messages, but is often unable to determine a more accurate explanation of 
  9869. these errors.  The message shown is the best information available based on the 
  9870. error codes returned by OS/2. 
  9871.  
  9872. The following list includes all error messages, in alphabetical order: 
  9873.  
  9874. Access denied:  You tried to write to or erase a read-only file, rename a file 
  9875. or directory to an existing name, create a directory that already exists, 
  9876. remove a read-only directory or a directory with files or subdirectories still 
  9877. in it, or access a file in use by another program in a multitasking system. 
  9878.  
  9879. Alias loop:  An alias refers back to itself either directly or indirectly 
  9880. (i.e., a = b = a), or aliases are nested more than 16 deep.  Correct your alias 
  9881. list. 
  9882.  
  9883. Bad disk unit:  Generally caused by a disk drive hardware failure. 
  9884.  
  9885. Batch file missing:  4OS2 can't find the batch (.BTM or .CMD ) file it was 
  9886. running.  It was either deleted, renamed, moved, or the disk was changed. 
  9887. Correct the problem and rerun the file. 
  9888.  
  9889. Can't copy file to itself:  You cannot COPY or MOVE a file to itself.  4OS2 
  9890. performs full path and filename expansion before copying to ensure that files 
  9891. aren't inadvertently destroyed. 
  9892.  
  9893. Can't create:  4OS2 can't create the specified file.  The disk may be full or 
  9894. write protected, or the file already exists and is read-only, or the root 
  9895. directory is full. 
  9896.  
  9897. Can't delete:  4OS2 can't delete the specified file or directory.  The disk is 
  9898. probably write protected. 
  9899.  
  9900. Can't get directory:  4OS2 can't read the directory.  The disk drive is 
  9901. probably not ready. 
  9902.  
  9903. Can't make directory entry:  4OS2 can't create the filename in the directory. 
  9904. This is usually caused by a full root directory. Create a subdirectory and move 
  9905. some of the files to it. 
  9906.  
  9907. Can't open:  4OS2 can't open the specified file.  Either the file doesn't exist 
  9908. or the disk directory or File Allocation Table is damaged. 
  9909.  
  9910. Can't remove current directory:  You attempted to remove the current directory, 
  9911. which OS/2 does not allow.  Change to the parent directory and try again. 
  9912.  
  9913. Command line too long:  A single command exceeded 1023 characters, or the 
  9914. entire command line exceeded 2047 characters, during alias and variable 
  9915. expansion.  Reduce the complexity of the command or use a batch file.  Also 
  9916. check for an alias which refers back to itself either directly or indirectly. 
  9917.  
  9918. Command only valid in batch file:  You have tried to use a batch file command, 
  9919. like DO or GOSUB, from the command line or in an alias.  A few commands can 
  9920. only be used in batch files (see the individual commands for details). 
  9921.  
  9922. Contents lost before copy:  COPY was appending files, and found one of the 
  9923. source files is the same as the target.  That source file is skipped, and 
  9924. appending continues with the next file. 
  9925.  
  9926. Data error:  OS/2 can't read or write properly to the device. On a floppy 
  9927. drive, this error is usually caused by a defective floppy disk, dirty disk 
  9928. drive heads, or a misalignment between the heads on your drive and the drive on 
  9929. which the disk was created. On a hard drive, this error may indicate a drive 
  9930. that is too hot or too cold, or a hardware problem.  Retry the operation; if it 
  9931. fails again, correct the hardware or diskette problem. 
  9932.  
  9933. Directory stack empty:  POPD or DIRS can't find any entries in the directory 
  9934. stack. 
  9935.  
  9936. Disk is write protected:  The disk cannot be written to.  Check the disk and 
  9937. remove the write-protect tab or close the write- protect window if necessary. 
  9938.  
  9939. Drive not ready -- close door:  The floppy disk drive door is open.  Close the 
  9940. door and try again. 
  9941.  
  9942. Environment already saved:  You have already saved the environment with a 
  9943. previous SETLOCAL command.  You cannot nest SETLOCAL / ENDLOCAL pairs. 
  9944.  
  9945. Error in command-line directive:  You used the //iniline option to place an 
  9946. .INI directive on the startup command line, but the directive is in error.  A 
  9947. more specific error message follows. 
  9948.  
  9949. Error on line [nnnn] of [filename]:  There is an error in your 4OS2.INI file. 
  9950. The following message explains the error in more detail.  Correct the line in 
  9951. error and restart 4OS2 for your change to take effect. 
  9952.  
  9953. Error reading:  OS/2 experienced an I/O error when reading from a device.  This 
  9954. is usually caused by a bad disk, a device not ready, or a hardware error. 
  9955.  
  9956. Error writing:  OS/2 experienced an I/O error when writing to a device.  This 
  9957. is usually caused by a full disk, a bad disk, a device not ready, or a hardware 
  9958. error. 
  9959.  
  9960. Exceeded batch nesting limit:  You have attempted to nest batch files more than 
  9961. 10 levels deep. 
  9962.  
  9963. File Allocation Table bad:  OS/2  can't access the FAT on the specified disk. 
  9964. This can be caused by a bad disk, a hardware error, or an unusual software 
  9965. interaction. 
  9966.  
  9967. File exists:  The requested output file already exists, and 4OS2 won't 
  9968. overwrite it. 
  9969.  
  9970. File not found:  4OS2 couldn't find the specified file.  Check the spelling and 
  9971. path name. 
  9972.  
  9973. General failure:  This is usually a hardware problem, particularly a disk drive 
  9974. failure or a device not properly connected to a serial or parallel port.  Try 
  9975. to correct the problem, or reboot and try again.  Also see Data error above; 
  9976. the problems described there can sometimes cause a general failure rather than 
  9977. a data error. 
  9978.  
  9979. Infinite COPY or MOVE loop:  You tried to COPY or MOVE a directory to one of 
  9980. its own subdirectories and used the /S switch, so the command would run 
  9981. forever.  Correct the command and try again. 
  9982.  
  9983. Insufficient disk space:  COPY or MOVE ran out of room on the destination 
  9984. drive.  Remove some files and retry the operation. 
  9985.  
  9986. Invalid character value:  You gave an invalid value for a character directive 
  9987. in the 4OS2.INI file. 
  9988.  
  9989. Invalid choice value:  You gave an invalid value for a "choice" directive (one 
  9990. that accepts a choice from a list, like "Yes" or "No") in the 4OS2.INI file. 
  9991.  
  9992. Invalid color:  You gave an invalid value for a color directive in the 4OS2.INI 
  9993. file. 
  9994.  
  9995. Invalid date:  An invalid date was entered.  Check the syntax and reenter. 
  9996.  
  9997. Invalid directive name:  4OS2 can't recognize the name of a directive in your 
  9998. 4OS2.INI file. 
  9999.  
  10000. Invalid drive:  A bad or non-existent disk drive was specified. 
  10001.  
  10002. Invalid key name:  You tried to make an invalid key substitution in the 
  10003. 4OS2.INI file, or you used an invalid key name in a keystroke alias or command. 
  10004. Correct the error and retry the operation. 
  10005.  
  10006. Invalid numeric value:  You gave an invalid value for a numeric directive in 
  10007. the 4OS2.INI file. 
  10008.  
  10009. Invalid parameter:  4OS2 didn't recognize a parameter.  Check the syntax and 
  10010. spelling of the command you entered. 
  10011.  
  10012. Invalid path:  The specified path does not exist.  Check the disk specification 
  10013. and/or spelling. 
  10014.  
  10015. Invalid path or file name:  You used an invalid path or filename in a directive 
  10016. in the 4OS2.INI file. 
  10017.  
  10018. Invalid time:  An invalid time was entered.  Check the syntax and reenter. 
  10019.  
  10020. Keystroke substitution table full:  4OS2 ran out of room to store keystroke 
  10021. substitutions entered in the 4OS2.INI file.  Reduce the number of key 
  10022. substitutions or contact JP Software for assistance. 
  10023.  
  10024. Label not found:  A GOTO or GOSUB referred to a non-existent label. Check your 
  10025. batch file. 
  10026.  
  10027. Missing ENDTEXT:  A TEXT command is missing a matching ENDTEXT.  Check the 
  10028. batch file. 
  10029.  
  10030. Missing GOSUB:  4OS2 cannot perform the RETURN command in a batch file.  You 
  10031. tried to do a RETURN without a GOSUB, or your batch file has been corrupted. 
  10032.  
  10033. Missing SETLOCAL:  An ENDLOCAL was used without a matching SETLOCAL. 
  10034.  
  10035. No aliases defined:  You tried to display aliases but no aliases have been 
  10036. defined. 
  10037.  
  10038. No closing quote:  4OS2 couldn't find a second matching back quote [`] or 
  10039. double-quote ["] on the command line. 
  10040.  
  10041. No expression:  The expression passed to the %@EVAL variable function is empty. 
  10042. Correct the expression and retry the operation. 
  10043.  
  10044. No room for INI file name:  4OS2 does not have enough space to pass the name of 
  10045. your 4OS2.INI file to secondary shells; see String area overflow for more 
  10046. details.  Any [Secondary] section in 4OS2.INI will be ignored in secondary 
  10047. shells until the problem is corrected and the system or session is restarted. 
  10048.  
  10049. Not an alias:  The specified alias is not in the alias list. 
  10050.  
  10051. Not in environment:  The specified variable is not in the environment. 
  10052.  
  10053. Not ready:  The specified device can't be accessed. 
  10054.  
  10055. Not same device:  This error usually appears in RENAME.  You cannot rename a 
  10056. file to a different disk drive. 
  10057.  
  10058. Out of memory:  4OS2 or OS/2 had insufficient memory to execute the last 
  10059. command.  Try to free some memory by closing other sessions.  If the error 
  10060. persists, contact JP Software for assistance. 
  10061.  
  10062. Out of paper:  OS/2 detected an out-of-paper condition on one of the printers 
  10063. (LPT1, LPT2, or LPT3).  Check your printer and add paper if necessary. 
  10064.  
  10065. Overflow:  An arithmetic overflow occurred in the %@EVAL variable function. 
  10066. Check the values being passed to %@EVAL. %@EVAL can handle 16 digits to the 
  10067. left of the decimal point and 8 to the right. 
  10068.  
  10069. Read error:  OS/2 encountered a disk read error; usually caused by a bad or 
  10070. unformatted disk. 
  10071.  
  10072. Sector not found:  Disk error, usually caused by a bad or unformatted disk. 
  10073.  
  10074. Seek error:  OS/2 can't seek to the proper location on the disk.  This is 
  10075. generally caused by a bad disk or drive. 
  10076.  
  10077. Sharing violation:  You tried to access a file in use by another program in a 
  10078. multitasking system or on a network.  Wait for the file to become available, or 
  10079. change your method of operation so that another program does not have the file 
  10080. open while you are trying to use it. 
  10081.  
  10082. String area overflow:  4OS2 ran out of room to store the text from string 
  10083. directives in the 4OS2.INI file.  Reduce the complexity of the 4OS2.INI file or 
  10084. contact JP Software for assistance. 
  10085.  
  10086. Syntax error:  A command or variable function was entered in an improper 
  10087. format.  Check the syntax and correct the error. 
  10088.  
  10089. Too many open files:  OS/2 has run out of file handles. Try increasing the 
  10090. FILES setting in CONFIG.SYS. 
  10091.  
  10092. Unbalanced parentheses:  The number of left and right parentheses did not match 
  10093. in an expression passed to the %@EVAL variable function.  Correct the 
  10094. expression and retry the operation. 
  10095.  
  10096. Unknown command:  A command was entered that 4OS2 didn't recognize and couldn't 
  10097. find in the current search path.  Check the spelling or PATH specification. 
  10098. You can handle unknown commands with the UNKNOWN_CMD alias (see ALIAS). 
  10099.  
  10100. Variable loop:  A nested environment variable refers to itself, or variables 
  10101. are nested more than 16 deep.  Correct the error and retry the command. 
  10102.  
  10103. Write error:  OS/2 encountered a disk write error; usually caused by a bad or 
  10104. unformatted disk. 
  10105.  
  10106.  
  10107. ΓòÉΓòÉΓòÉ 16. Reference Tables ΓòÉΓòÉΓòÉ
  10108.  
  10109. The reference tables in this section are based on U.S. English conventions. 
  10110. Your system may differ if it is configured for a different country or language. 
  10111. See your operating system documentation for more information about country and 
  10112. language support. 
  10113.  
  10114. To represent the text you type, computers must translate each letter to and 
  10115. from a number.  The code used by all PC-compatible computers for this 
  10116. translation is called ASCII.  Function keys, cursor keys, and Alt keys generate 
  10117. scan codes indicating which key was pressed, but not ASCII codes. The tables in 
  10118. this section cover both kinds of codes. 
  10119.  
  10120. For more information, see: 
  10121.  
  10122.             ASCII Table 
  10123.             Key Codes and Scan Codes Table 
  10124.             Key Codes and Scan Codes Explanation 
  10125.             ANSI Commands 
  10126.  
  10127.  
  10128. ΓòÉΓòÉΓòÉ 16.1. ASCII Table ΓòÉΓòÉΓòÉ
  10129.  
  10130.                       Control Characters
  10131.  
  10132.     Dec  Hex  Chr  Nam  Ctl   Γöé   Dec  Hex  Chr  Nam  Ctl
  10133.     ---  ---  ---  ---  ---   Γöé   ---  ---  ---  ---  ---
  10134.     000   00       NUL   ^@   Γöé   016   10      DLE   ^P
  10135.     001   01      SOH   ^A   Γöé   017   11      DC1   ^Q
  10136.     002   02      STX   ^B   Γöé   018   12      DC2   ^R
  10137.     003   03      ETX   ^C   Γöé   019   13      DC3   ^S
  10138.     004   04      EOT   ^D   Γöé   020   14      DC4   ^T
  10139.     005   05      ENQ   ^E   Γöé   021   15      NAK   ^U
  10140.     006   06      ACK   ^F   Γöé   022   16      SYN   ^V
  10141.     007   07       BEL   ^G   Γöé   023   17      ETB   ^W
  10142.     008   08      BS    ^H   Γöé   024   18      CAN   ^X
  10143.     009   09       HT    ^I   Γöé   025   19      EM    ^Y
  10144.     010   0A       LF    ^J   Γöé   026   1A      SUB   ^Z
  10145.     011   0B       VT    ^K   Γöé   027   1B      ESC   ^[
  10146.     012   0C       FF    ^L   Γöé   028   1C      FS    ^\
  10147.     013   0D       CR    ^M   Γöé   029   1D      GS    ^]
  10148.     014   0E      SO    ^N   Γöé   030   1E      RS    ^^
  10149.     015   0F      SI    ^O   Γöé   031   1F      US    ^_
  10150.  
  10151.                   Punctuation, Digits, Upper Case
  10152.  
  10153.   Dec  Hex  Chr Γöé  Dec  Hex  Chr Γöé  Dec  Hex  Chr Γöé  Dec  Hex  Chr
  10154.   ---  ---  --- Γöé  ---  ---  --- Γöé  ---  ---  --- Γöé  ---  ---  ---
  10155.   032   20      Γöé  048   30   0  Γöé  064   40   @  Γöé  080   50   P
  10156.   033   21   !  Γöé  049   31   1  Γöé  065   41   A  Γöé  081   51   Q
  10157.   034   22   "  Γöé  050   32   2  Γöé  066   42   B  Γöé  082   52   R
  10158.   035   23   #  Γöé  051   33   3  Γöé  067   43   C  Γöé  083   53   S
  10159.   036   24   $  Γöé  052   34   4  Γöé  068   44   D  Γöé  084   54   T
  10160.   037   25   %  Γöé  053   35   5  Γöé  069   45   E  Γöé  085   55   U
  10161.   038   26   &  Γöé  054   36   6  Γöé  070   46   F  Γöé  086   56   V
  10162.   039   27   '  Γöé  055   37   7  Γöé  071   47   G  Γöé  087   57   W
  10163.   040   28   (  Γöé  056   38   8  Γöé  072   48   H  Γöé  088   58   X
  10164.   041   29   )  Γöé  057   39   9  Γöé  073   49   I  Γöé  089   59   Y
  10165.   042   2A   *  Γöé  058   3A   :  Γöé  074   4A   J  Γöé  090   5A   Z
  10166.   043   2B   +  Γöé  059   3B   ;  Γöé  075   4B   K  Γöé  091   5B   [
  10167.   044   2C   ,  Γöé  060   3C   <  Γöé  076   4C   L  Γöé  092   5C   \
  10168.   045   2D   -  Γöé  061   3D   =  Γöé  077   4D   M  Γöé  093   5D   ]
  10169.   046   2E   .  Γöé  062   3E   >  Γöé  078   4E   N  Γöé  094   5E   ^
  10170.   047   2F   /  Γöé  063   3F   ?  Γöé  079   4F   O  Γöé  095   5F   _
  10171.  
  10172.                    Lower Case, Miscellaneous
  10173.  
  10174.                  Dec  Hex  Chr Γöé  Dec  Hex  Chr
  10175.                  ---  ---  --- Γöé  ---  ---  ---
  10176.                  096   60   `  Γöé  112   70   p
  10177.                  097   61   a  Γöé  113   71   q
  10178.                  098   62   b  Γöé  114   72   r
  10179.                  099   63   c  Γöé  115   73   s
  10180.                  100   64   d  Γöé  116   74   t
  10181.                  101   65   e  Γöé  117   75   u
  10182.                  102   66   f  Γöé  118   76   v
  10183.                  103   67   g  Γöé  119   77   w
  10184.                  104   68   h  Γöé  120   78   x
  10185.                  105   69   i  Γöé  121   79   y
  10186.                  106   6A   j  Γöé  122   7A   z
  10187.                  107   6B   k  Γöé  123   7B   {
  10188.                  108   6C   l  Γöé  124   7C   |
  10189.                  109   6D   m  Γöé  125   7D   }
  10190.                  110   6E   n  Γöé  126   7E   ~
  10191.                  111   6F   o  Γöé  127   7F   
  10192.  
  10193.                 International; Graphics Characters 1
  10194.  
  10195.   Dec  Hex  Chr Γöé  Dec  Hex  Chr Γöé  Dec  Hex  Chr Γöé  Dec  Hex  Chr
  10196.   ---  ---  --- Γöé  ---  ---  --- Γöé  ---  ---  --- Γöé  ---  ---  ---
  10197.   128   80   ╨É  Γöé  144   90   ╨á  Γöé  160   A0   ╨░  Γöé  176   B0   Γûæ
  10198.   129   81   ╨æ  Γöé  145   91   ╨í  Γöé  161   A1   ╨▒  Γöé  177   B1   ΓûÆ
  10199.   130   82   ╨Æ  Γöé  146   92   ╨ó  Γöé  162   A2   ╨▓  Γöé  178   B2   Γûô
  10200.   131   83   ╨ô  Γöé  147   93   ╨ú  Γöé  163   A3   ╨│  Γöé  179   B3   Γöé
  10201.   132   84   ╨ö  Γöé  148   94   ╨ñ  Γöé  164   A4   ╨┤  Γöé  180   B4   Γöñ
  10202.   133   85   ╨ò  Γöé  149   95   ╨Ñ  Γöé  165   A5   ╨╡  Γöé  181   B5   Γòí
  10203.   134   86   ╨û  Γöé  150   96   ╨ª  Γöé  166   A6   ╨╢  Γöé  182   B6   Γòó
  10204.   135   87   ╨ù  Γöé  151   97   ╨º  Γöé  167   A7   ╨╖  Γöé  183   B7   Γòû
  10205.   136   88   ╨ÿ  Γöé  152   98   ╨¿  Γöé  168   A8   ╨╕  Γöé  184   B8   Γòò
  10206.   137   89   ╨Ö  Γöé  153   99   ╨⌐  Γöé  169   A9   ╨╣  Γöé  185   B9   Γòú
  10207.   138   8A   ╨Ü  Γöé  154   9A   ╨¬  Γöé  170   AA   ╨║  Γöé  186   BA   Γòæ
  10208.   139   8B   ╨¢  Γöé  155   9B   ╨½  Γöé  171   AB   ╨╗  Γöé  187   BB   Γòù
  10209.   140   8C   ╨£  Γöé  156   9C   ╨¼  Γöé  172   AC   ╨╝  Γöé  188   BC   Γò¥
  10210.   141   8D   ╨¥  Γöé  157   9D   ╨¡  Γöé  173   AD   ╨╜  Γöé  189   BD   Γò£
  10211.   142   8E   ╨₧  Γöé  158   9E   ╨«  Γöé  174   AE   ╨╛  Γöé  190   BE   Γò¢
  10212.   143   8F   ╨ƒ  Γöé  159   9F   ╨»  Γöé  175   AF   ╨┐  Γöé  191   BF   ΓöÉ
  10213.  
  10214.                   Graphics Characters 2; Symbols
  10215.  
  10216.   Dec  Hex  Chr Γöé  Dec  Hex  Chr Γöé  Dec  Hex  Chr Γöé  Dec  Hex  Chr
  10217.   ---  ---  --- Γöé  ---  ---  --- Γöé  ---  ---  --- Γöé  ---  ---  ---
  10218.   192   C0   Γöö  Γöé  208   D0   Γò¿  Γöé  224   E0   ╤Ç  Γöé  240   F0   ╨ü
  10219.   193   C1   Γö┤  Γöé  209   D1   Γòñ  Γöé  225   E1   ╤ü  Γöé  241   F1   ╤æ
  10220.   194   C2   Γö¼  Γöé  210   D2   ΓòÑ  Γöé  226   E2   ╤é  Γöé  242   F2   ╨ä
  10221.   195   C3   Γö£  Γöé  211   D3   ΓòÖ  Γöé  227   E3   ╤â  Γöé  243   F3   ╤ö
  10222.   196   C4   ΓöÇ  Γöé  212   D4   Γòÿ  Γöé  228   E4   ╤ä  Γöé  244   F4   ╨ç
  10223.   197   C5   Γö╝  Γöé  213   D5   ΓòÆ  Γöé  229   E5   ╤à  Γöé  245   F5   ╤ù
  10224.   198   C6   Γò₧  Γöé  214   D6   Γòô  Γöé  230   E6   ╤å  Γöé  246   F6   ╨Ä
  10225.   199   C7   Γòƒ  Γöé  215   D7   Γò½  Γöé  231   E7   ╤ç  Γöé  247   F7   ╤₧
  10226.   200   C8   ΓòÜ  Γöé  216   D8   Γò¬  Γöé  232   E8   ╤ê  Γöé  248   F8   ┬░
  10227.   201   C9   Γòö  Γöé  217   D9   Γöÿ  Γöé  233   E9   ╤ë  Γöé  249   F9   ΓêÖ
  10228.   202   CA   Γò⌐  Γöé  218   DA   Γöî  Γöé  234   EA   ╤è  Γöé  250   FA   ┬╖
  10229.   203   CB   Γòª  Γöé  219   DB   Γûê  Γöé  235   EB   ╤ï  Γöé  251   FB   ΓêÜ
  10230.   204   CC   Γòá  Γöé  220   DC   Γûä  Γöé  236   EC   ╤î  Γöé  252   FC   Γäû
  10231.   205   CD   ΓòÉ  Γöé  221   DD   Γûî  Γöé  237   ED   ╤ì  Γöé  253   FD   ┬ñ
  10232.   206   CE   Γò¼  Γöé  222   DE   ΓûÉ  Γöé  238   EE   ╤Ä  Γöé  254   FE   Γûá
  10233.   207   CF   Γòº  Γöé  223   DF   ΓûÇ  Γöé  239   EF   ╤Å  Γöé  255   FF
  10234.  
  10235.  
  10236. ΓòÉΓòÉΓòÉ 16.2. Key Codes and Scan Codes Table ΓòÉΓòÉΓòÉ
  10237.  
  10238. (For more details on key codes and scan codes, see the Key Codes and Scan Codes 
  10239. Explanation.) 
  10240.  
  10241. Key names prefaced by np are on the numeric keypad.  Those prefaced by cp are 
  10242. on the cursor keypad between the main typing keys and the number keypad.  The 
  10243. numeric keypad values are valid if Num Lock is turned off.  If you need to 
  10244. specify a number key from the numeric keypad, use the scan code shown for the 
  10245. keypad and the ASCII code shown for the corresponding typewriter key.  For 
  10246. example, the keypad "7" has a scan code of 71 (the np Home scan code) and an 
  10247. ASCII code of 54 (the ASCII code for "7"). 
  10248.  
  10249. The chart is blank for key combinations that do not have scan codes or ASCII 
  10250. codes, like Ctrl-1 or Alt-PgUp. 
  10251.  
  10252.  
  10253.                         Top Two Keyboard Rows
  10254.  
  10255.                              Shift  Shift  Ctrl   Ctrl   Alt
  10256.                Scan   ASCII  Scan   ASCII  Scan   ASCII  Scan
  10257.      Key       Code   Code   Code   Code   Code   Code   Code
  10258.  
  10259.      Esc       1      27     1      27     1      27     1
  10260.      1  !      2      49     2      33                   120
  10261.      2  @      3      50     3      64     3      0      121
  10262.      3  #      4      51     4      35                   122
  10263.      4  $      5      52     5      36                   123
  10264.      5  %      6      53     6      37                   124
  10265.      6  ^      7      54     7      94     7      30     125
  10266.      7  &      8      55     8      38                   126
  10267.      8  *      9      56     9      42                   127
  10268.      9  (      10     57     10     40                   128
  10269.      0  )      11     48     11     41                   129
  10270.      -  _      12     45     12     95     12     31     130
  10271.      =  +      13     61     13     43                   131
  10272.      Backspace 14     8      14     8      14     127    14
  10273.      Tab       15     9      15     0      148    0      165
  10274.      Q         16     113    16     81     16     17     16
  10275.      W         17     119    17     87     17     23     17
  10276.      E         18     101    18     69     18     5      18
  10277.      R         19     114    19     82     19     18     19
  10278.      T         20     116    20     84     20     20     20
  10279.      Y         21     121    21     89     21     25     21
  10280.      U         22     117    22     85     22     21     22
  10281.      I         23     105    23     73     23     9      23
  10282.      O         24     111    24     79     24     15     24
  10283.      P         25     112    25     80     25     16     25
  10284.      [  {      26     91     26     123    26     27     26
  10285.      ]  }      27     93     27     125    27     29     27
  10286.      Enter     28     13     28     13     28     10     28
  10287.  
  10288.  
  10289.                        Bottom Two Keyboard Rows
  10290.  
  10291.                              Shift  Shift  Ctrl   Ctrl   Alt
  10292.                Scan   ASCII  Scan   ASCII  Scan   ASCII  Scan
  10293.      Key       Code   Code   Code   Code   Code   Code   Code
  10294.  
  10295.     A          30     97     30     65     30     1      30
  10296.     S          31     115    31     83     31     19     31
  10297.     D          32     100    32     68     32     4      32
  10298.     F          33     102    33     70     33     6      33
  10299.     G          34     103    34     71     34     7      34
  10300.     H          35     104    35     72     35     8      35
  10301.     J          36     106    36     74     36     10     36
  10302.     K          37     107    37     75     37     11     37
  10303.     L          38     108    38     76     38     12     38
  10304.     ; :        39     59     39     58                   39
  10305.     '  "       40     39     40     34                   40
  10306.     `  ~       41     96     41     126                  41
  10307.     \  |       43     92     43     124    43     28     43
  10308.     Z          44     122    44     90     44     26     44
  10309.     X          45     120    45     88     45     24     45
  10310.     C          46     99     46     67     46     3      46
  10311.     V          47     118    47     86     47     22     47
  10312.     B          48     98     48     66     48     2      48
  10313.     N          49     110    49     78     49     14     49
  10314.     M          50     109    50     77     50     13     50
  10315.     ,  <       51     44     51     60                   51
  10316.     .  >       52     46     52     62                   52
  10317.     /  ?       53     47     53     63                   53
  10318.     Space      57     32     57     32     57     32     57
  10319.  
  10320.  
  10321.                       Key Pads and Function Keys
  10322.  
  10323.                              Shift  Shift  Ctrl   Ctrl   Alt
  10324.                Scan   ASCII  Scan   ASCII  Scan   ASCII  Scan
  10325.      Key       Code   Code   Code   Code   Code   Code   Code
  10326.  
  10327.  
  10328.      F1        59     0      84     0      94     0      104
  10329.      F2        60     0      85     0      95     0      105
  10330.      F3        61     0      86     0      96     0      106
  10331.      F4        62     0      87     0      97     0      107
  10332.      F5        63     0      88     0      98     0      108
  10333.      F6        64     0      89     0      99     0      109
  10334.      F7        65     0      90     0      100    0      110
  10335.      F8        66     0      91     0      101    0      111
  10336.      F9        67     0      92     0      102    0      112
  10337.      F10       68     0      93     0      103    0      113
  10338.      F11       133    0      135    0      137    0      139
  10339.      F12       134    0      136    0      138    0      140
  10340.      np *      55     42     55     42     150    0      55
  10341.      np Home   71     0      71     55     119    0
  10342.      cp Home   71     224    71     224    119    224    151
  10343.      np Up     72     0      72     56     141    0
  10344.      cp Up     72     224    72     224    141    224    152
  10345.      np PgUp   73     0      73     57     132    0
  10346.      cp PgUp   73     224    73     224    132    224    153
  10347.      np Minus  74     45     74     45     142    0      74
  10348.      np Left   75     0      75     52     115    0
  10349.      cp Left   75     224    75     224    115    224    155
  10350.      np 5      76     0      76     53     143    0
  10351.      np Right  77     0      77     54     116    0
  10352.      cp Right  77     224    77     224    116    224    157
  10353.      np Plus   78     43     78     43     144    0      78
  10354.      np End    79     0      79     49     117    0
  10355.      cp End    79     224    79     224    117    224    159
  10356.      np Down   80     0      80     50     145    0
  10357.      cp Down   80     224    80     224    145    224    160
  10358.      np PgDn   81     0      81     51     118    0
  10359.      cp PgDn   81     224    81     224    118    224    161
  10360.      np Ins    82     0      82     48     146    0
  10361.      cp Ins    82     224    82     224    146    224    162
  10362.      np Del    83     0      83     46     147    0
  10363.      cp Del    83     224    83     224    147    224    163
  10364.      np /      224    47     224    47     149    0      164
  10365.      np Enter  224    13     224    13     224    10     166
  10366.  
  10367.  
  10368. ΓòÉΓòÉΓòÉ 16.3. Key Codes and Scan Codes Explanation ΓòÉΓòÉΓòÉ
  10369.  
  10370. (This section explains how key codes and scan codes work.  For a reference 
  10371. chart, see the Key Codes and Scan Codes Table.) 
  10372.  
  10373. When you press a single key or a key combination, OS/2 translates your 
  10374. keystroke into two numbers: a scan code, representing the actual key that was 
  10375. pressed, and an ASCII code, representing the ASCII value for that key.  OS/2 
  10376. returns these numbers the next time a program requests keyboard input.  This 
  10377. section explains how key codes work; for information on using them with 4OS2 
  10378. see the 4OS2.INI file key mapping directives, keystroke aliases, and INKEY. 
  10379.  
  10380. Most 4OS2 commands that use the numeric key codes listed here also use key 
  10381. names, which are usually more convenient to use than the numeric codes.  See 
  10382. Keys and Key Names for more information on key names. 
  10383.  
  10384. As PCs have evolved, the structure of keyboard codes has evolved somewhat 
  10385. haphazardly with them, resulting in a bewildering array of possible key codes. 
  10386. We'll give you a basic explanation of how key codes work.  For a more in-depth 
  10387. discussion, refer to a BIOS or PC hardware reference manual. 
  10388.  
  10389. The nuances of how your keyboard behaves depends on the keyboard manufacturer, 
  10390. the computer manufacturer who provides the built-in BIOS, and your operating 
  10391. system.  As a result, we can't guarantee the accuracy of the information in the 
  10392. tables for every system, but the discussion and reference table should be 
  10393. accurate for most systems.  Our discussion is based on the 101-key "enhanced" 
  10394. keyboard commonly used on 286, 386, 486, and Pentium computers, but virtually 
  10395. all of it is applicable to the 84-key keyboards on older systems.  The primary 
  10396. difference is that older keyboards lack a separate cursor pad and only have 10 
  10397. function keys. 
  10398.  
  10399. All keys have a scan code, but not all have an ASCII code.  For example, 
  10400. function keys and cursor keys are not part of the ASCII character set and have 
  10401. no ASCII value, but they do have a scan code.  Some keys have more than one 
  10402. ASCII code.  The A, for example, has ASCII code 97 (lower case "a") if you 
  10403. press it by itself.  If you press it along with Shift, the ASCII code changes 
  10404. to 65 (upper case "A").  If you press Ctrl and A the ASCII code changes to 1. 
  10405. In all these cases, the scan code (30) is unchanged because you are pressing 
  10406. the same physical key. 
  10407.  
  10408. Things are different if you press Alt-A.  Alt keystrokes have no ASCII code, so 
  10409. OS/2 returns an ASCII code of 0, along with the A key's scan code of 30.  This 
  10410. allows a program to detect all the possible variations of A, based on the 
  10411. combination of ASCII code and scan code. 
  10412.  
  10413. Some keys generate more than one scan code depending on whether Shift, Ctrl, or 
  10414. Alt is pressed.  This allows a program to differentiate between two different 
  10415. keystrokes on the same key, neither of which has a corresponding ASCII value. 
  10416. For example, F1 has no ASCII value so it returns an ASCII code of 0, and the F1 
  10417. scan code of 59.  Shift-F1 also returns an ASCII code 0; if it also returned a 
  10418. scan code of 59, a program couldn't distinguish it from F1.  The operating 
  10419. system translates scan codes for keys like Shift-F1 (and Ctrl-F1 and Alt-F1) so 
  10420. that each variation returns a different scan code along with an ASCII code of 
  10421. 0. 
  10422.  
  10423. On the 101-key keyboard there's one more variation:  non-ASCII keys on the 
  10424. cursor keypad (such as up-arrow) return the same scan code as the corresponding 
  10425. key on the numeric keypad, for compatibility reasons.  If they also returned an 
  10426. ASCII code of 0, a program couldn't tell which key was pressed.  Therefore, 
  10427. these keys return an ASCII code of 224 rather than 0.  This means that older 
  10428. programs, which only look for an ASCII 0 to indicate a non-ASCII keystroke like 
  10429. up-arrow, may not detect these cursor pad keys properly. 
  10430.  
  10431. The number of different codes returned by any given key varies from one (for 
  10432. the spacebar) to four, depending on the key, the design of your keyboard, and 
  10433. the operating system.  Some keys, like Alt, Ctrl, and Shift by themselves or in 
  10434. combination with each other, plus Print Screen, SysReq, Scroll Lock, Pause, 
  10435. Break, Num Lock, and Caps Lock keys, do not have any code representations at 
  10436. all.  The same is true of keystrokes with more than one modifying key, like 
  10437. Ctrl-Shift-A. The operating system may perform special actions automatically 
  10438. when you press these keys (for example, it switches into Caps Lock mode when 
  10439. you press Caps Lock), but it does not report the keystrokes to whatever program 
  10440. is running.  Programs which detect such keystrokes access the keyboard hardware 
  10441. directly, a subject which is beyond the scope of this manual. 
  10442.  
  10443.  
  10444. ΓòÉΓòÉΓòÉ 16.4. ANSI ΓòÉΓòÉΓòÉ
  10445.  
  10446. This section is a quick-reference to commonly-used ANSI commands. 
  10447.  
  10448. An ANSI command string consists of three parts: 
  10449.  
  10450.         ESC[                The ASCII character ESC, followed by a left 
  10451.                             bracket.  These two characters must be present in 
  10452.                             all ANSI strings. 
  10453.         parameters          Optional parameters for the command.  If there are 
  10454.                             multiple parameters they are separated by 
  10455.                             semicolons. 
  10456.         cmd                 A single-letter command.  The case of the letter IS 
  10457.                             meaningful. 
  10458.  
  10459.  For example, to position the cursor to row 7, column 12 the ANSI command is: 
  10460.  
  10461.           ESC[7;12H
  10462.  
  10463.  To transmit ANSI commands to the screen with 4OS2, you should use the ECHO 
  10464.  command.  The ESC character can be generated by inserting it into the string 
  10465.  directly (if you are putting the string in a batch file and your editor will 
  10466.  insert such a character), or by using 4OS2's internal "escape" character 
  10467.  (caret, [^]) followed by a lower-case "e".  For example, the sequence shown 
  10468.  above could be transmitted from a batch file with either of these commands 
  10469.  (the first uses an ESC character directly; the second uses ^e): 
  10470.  
  10471.           echo 2H
  10472.           echo ^e[7;12H
  10473.  
  10474.  You can also include ANSI commands in your prompt, using $e to transmit the 
  10475.  ESC character.  You can NOT use PROMPT to transmit ANSI commands to the screen 
  10476.  from a batch file (see PROMPT). 
  10477.  
  10478.  Commands 
  10479.  
  10480.         ESC[rowsA               Cursor up 
  10481.         ESC[rowsB               Cursor down 
  10482.         ESC[colsC               Cursor right 
  10483.         ESC[colsD               Cursor left 
  10484.         ESC[row;colH            Set cursor position (top left is row 1, column 
  10485.                                 1) 
  10486.         ESC[2J                  Clear screen 
  10487.         ESC[K                   Clear from cursor to end of line 
  10488.         ESC[row;colf            Set cursor position, same as "H" command 
  10489.         ESC[attr;attr;...m      Set display attributes; see table of attribute 
  10490.                                 values below 
  10491.         ESC[s                   Save cursor position (may not be nested) 
  10492.         ESC[u                   Restore cursor position after a save 
  10493.  
  10494.  Display Attributes 
  10495.  
  10496.         0           All attributes off (normal white on black) 
  10497.         1           High intensity (bold) 
  10498.         2           Normal intensity 
  10499.         4           Underline (usually effective only on monochrome displays) 
  10500.         5           Blinking 
  10501.         7           Reverse Video 
  10502.         8           Invisible 
  10503.         30-37       Set the foreground color: 
  10504.                       30=Black  31=Red    32=Green  33=Yellow 
  10505.                       34=Blue   35=Magenta  36=Cyan   37=White 
  10506.         40-47       Set the background color, same values as above but 
  10507.                     substitute 40 for 30 etc. 
  10508.  
  10509.  Settings are cumulative, so (for example) to set bright red foreground set all 
  10510.  attributes off, then set red, then bold, use: 
  10511.  
  10512.           echo ^e[0;31;1m
  10513.  
  10514.  Examples 
  10515.  
  10516.  Clear the display attributes, then set the display to bright cyan on blue, and 
  10517.  clear the screen: 
  10518.  
  10519.           echo ^e[0;44;36;1m^e[2J
  10520.  
  10521.  Set up a prompt which saves the cursor position, displays the 4DOS shell 
  10522.  level, date, and time on the top line in bright white on magenta, and then 
  10523.  restores the cursor position and sets the color to bright cyan on blue, and 
  10524.  displays the standard prompt: 
  10525.  
  10526.           prompt $e[s$e[1;1f$e[0;45;37;1m$e[K($z) $d $t$e[u$e[0;44;36;1m$p$g
  10527.  
  10528.  
  10529. ΓòÉΓòÉΓòÉ 17. Support ΓòÉΓòÉΓòÉ
  10530.  
  10531. You can contact JP Software at any of the following addresses.  Our normal 
  10532. business hours are 9:00 AM to 5:00 PM weekdays, eastern US time. 
  10533.  
  10534. By mail: 
  10535.  
  10536.         JP Software Inc. 
  10537.         P.O. Box 1470 
  10538.         East Arlington, MA 02174 
  10539.         USA 
  10540.  
  10541.  By telephone / fax: 
  10542.  
  10543.         Voice           (617) 646-3975 
  10544.         Fax             (617) 646-0904 
  10545.         Order Line      (800) 368-8777 (orders only, USA only) 
  10546.  
  10547.  Electronically: 
  10548.  
  10549.         CompuServe      Customer Service 75020,244 
  10550.                         Technical Support, GO JPSOFT or GO PCVENB (section 10), 
  10551.                         User ID 75300,1215 
  10552.         Internet        Customer Service 75020.244@compuserve.com 
  10553.                         Technical Support 75300.1215@compuserve.com 
  10554.         BBS Support     Via Channel 1 BBS, Boston, 617-354-5776 at 2,400 - 
  10555.                         14,400 baud, no parity, 8 data bits, 1 stop bit. 
  10556.  
  10557.  Technical support is available via public electronic support conferences, 
  10558.  private electronic mail, telephone, fax, and mail. 
  10559.  
  10560.  Often the best way to contact us for support is in one of the following public 
  10561.  electronic support conferences.  The numbers in parentheses indicate the usual 
  10562.  delay, in business days, to receive a reply to a message. 
  10563.  
  10564.  CompuServe / ZiffNet:  Primary support is via the JP Software section of the 
  10565.  CompuServe PCVENB forum (GO JPSOFT or GO PCVENB, section 10, "JP Software") (1 
  10566.  day). 
  10567.  
  10568.  Bulletin Boards:  Primary support is via the Channel 1 BBS, Boston, MA (1 - 3 
  10569.  days; see above for access details).  Messages may be left in any of the 
  10570.  "4DOS" conferences; check the online list for exact conference numbers. 
  10571.  Support is also available from many local BBSes via the "4DOS" conferences on 
  10572.  the RIME, ILink, SmartNet, and FidoNet BBS Networks (3-5 days). 
  10573.  
  10574.  Before contacting us for support, please check the manuals and other 
  10575.  documentation for answers to your question.  If you can't find what you need, 
  10576.  try the Index.  If you're having trouble getting 4OS2 to run properly, either 
  10577.  alone or with your particular hardware or software, see the Introduction and 
  10578.  Installation Guide, and the APPNOTES.DOC file.  Also look through the 
  10579.  README.DOC and UPDATxxx.DOC files, as they may contain updates to the manual 
  10580.  or other important information ("xxx" is the version number). 
  10581.  
  10582.  If you do need to contact us for support, it helps if you can give us some 
  10583.  basic information: 
  10584.  
  10585.     *   What exactly did you do?  A concise description of what steps you must 
  10586.         take to make the problem appear is much more useful than a long 
  10587.         analysis of what might be happening. 
  10588.  
  10589.     *   What went wrong?  At what point did the failure occur?  If you saw an 
  10590.         error message or other important or unusual information on the screen, 
  10591.         what exactly did it say? 
  10592.  
  10593.     *   Briefly, what techniques did you use to try to resolve the problem? 
  10594.         What results did you get? 
  10595.  
  10596.     *   What computer and operating system version are you using? 
  10597.  
  10598.     *   Are you running a network?  If so, which one, and which version? 
  10599.  
  10600.     *   What are the contents of any startup files you use (such as CONFIG.SYS, 
  10601.         4START, 4EXIT, and 4OS2.INI ), any batch files they call, and any alias 
  10602.         or environment variable files they load? 
  10603.  
  10604.     *   Can you repeat the problem or does it occur randomly?  If it's random, 
  10605.         does it seem related to the programs you're using when the problem 
  10606.         occurs? 
  10607.