Command Overview Copyright (c) 1986 Solid Applications Inc. 1333 Moon Drive Yardley, PA 19067 Command is a shareware product from Solid Applications Inc. You are allowed to give a copy of the PCOMMAND.PRG program and this documentation to anyone for no charge. The program may not be sold or included as part of a package for sale without prior written approval from Solid Applications. We encourage you to distribute this package to your friends and coworkers who are using the Atari ST. You may register your copy of PCommand with Solid Applications for $25.00. You will receive a copy of the full documentation and a disk containing the desk accessory version of PCommand along with some useful utilities including a format program which creates diskettes that can be read on an IBM PC (both single and double sided disks). WHAT IS PCOMMAND: Command is a line-oriented command line interpreter with batch file support. It provides an interactive interface to Atari TOS which runs on the Atari ST. Commands are similar to PC-DOS commands PCommand provides faster access to TOS facilities than the GEM desktop. Multiple commands can be entered on a single line for even better efficiency. Command has a number of built-in commands which are always available and can run GEM or TOS-based applications by simply typing their name. A list of local commands is displayed by typing HELP. The batch file facility can be used to present GEM-based menus and alert boxes. This allows a GEM interface to be built using a text editor to create a batch file. Most text editors available for the ST will work. SPECIAL KEYS AND EDITING Commands entered at the command prompt can be edited using the following special keys. control-S Suspend output control-Q Continue output control-C Enter query mode if BREAK is ON ESC same as control-C RETURN Use current line as command control-A Move to start of line control-B Move forward one character control-C Copy template until matching character control-E Move to end of line control-F Move backward one character control-J Skip to next template character control-N Copy next template character control-R Restart entry on the next line control-T Make current input into template control-X Delete current line control-Z Copy rest of template ESC Same as control-X Left arrow Same as control-B Right arrow Same as control-F Home Same as control-R Undo Same as control-Z Shifted left arrow Same as control-A Shifted right arrow Same as control-E Shifted Home/Clr Same as control-X F1 Same as control-N F2 Same as control-C F3 Same as control-Z F4 Same as control-J F5 Same as control-T BUILT-IN COMMANDS Command has a number of built-in commands which can be entered directly or used in batch files. There is also a small set of commands which can only be used within a batch file. The following is a list of built-in commands. ? Show built-in command list ABORT Show/Set Abort option BELL Sound bell BREAK Show/Set Break option BYE Exit from batch file/PCommand CD Change current directory * CHAIN Chain to new batch file CHDIR Change current directory CLS Clear screen COPY Copy file(s) CP Copy file(s) CTTY Show/set console device DATE Show/set date DEL Delete file(s) DIR Show directory D Show directory ECHO Set/show/display text ERASE Delete file(s) ERA Delete file(s) EXIT Exit from batch file/PCommand * FOR Iterate over file name(s) GEM Show/set/menu interface * GOTO Goto label in batch file HELP Show built-in command list) * IF Conditional command execution INPUT Interactive/text input LOG Show/set command logging status MKDIR Make new directory MD Make new directory PATH Show/set default search path PAUSE Wait for input PRINT Print file(s) PROMPT Show/set prompt QED Quick editor for creating batch files REM Remark (comment) REN Rename a file RENAME Rename a file RESERVE Reserve memory for program RMDIR Remove directory RD Remove directory SET Show/Set environment string * SHIFT Shift arguments STACK Show current execution stack SWITCHAR Show/set switch character TIME Show/set time TOS Execute program in TOS environment TYPE Type file on console VER Display TOS version number VERIFY Show/Set floppy disk verify mode VOL Show disk volume label WRAP Show/Set end of line wrap mode * indicates batch file use only. Multiple commands are placed on a line by separating them with an exclamation point, '!'. Command lines can be up to 160 characters. Labels are the GOTO command are names immediately preceeded by a colon, ':'. Any text after a label is assumed to be a comment. Batch file parameters are indicated by a leading percent sign, '%'. A single digit after '%' indicates a parameter to the batch file. The parameter relaces both the percent sign and digit. Any of the following special characters can be used if the percent sign is immediately followed by a colon, ':'. %:c first character from last INPUT result %:d disk letter from last GEM :FILE command %:e ERRORLEVEL from last program %:f file name from last GEM :FILE command %:i string from last INPUT result %:p path name from last GEM :FILE command %:v video mode (0=low, 1=medium, 2=mono) %:: current time %:/ current date BUILT-IN COMMANDS General syntax: optional items are placed within square brackets such as [XYZ]. Alternatives are separated by a vertical bar as with ON|OFF. Repeated items are followed by ellipses (...). Note, keywords do not have to be capitalized when used. ? Help command, no parameters, print built-in commands ABORT [ON|OFF] Set/show ABORT flag, OFF indicates termination when BREAK is ON and a control-C or ESC key is pressed. ON prints the STACK status and allows the system to be restarted at the specified point. BELL Sounds the bell. BREAK [ON|OFF] PCommand recognizes control-C and ESC only if the BREAK flag is ON. BYE [number|ON|OFF] Same as EXIT command. Set the EXIT flag or exit from the current batch file or input mode for 1 or more (number) levels. CD [drive:|path]... Same as CHDIR, set/show current default directory of the current or specified drive. CHAIN file [parameter ...] (Batch file only) Exit current batch file and continue execution of the new batch 'file' using new 'parameters'. CHDIR Same as CD command CLS [option] Clear part of screen which 'option' is: LINE all of the current line EOL from cursor to end of line EOS from cursor to end of screen BOL from cursor to beginning of line BOS from cursor to beginning of screen INSERT insert new line, delete the one at the bottom of the screen DELETE delete current line, add one at the bottom of the screen COPY source [...] [destination] [/D] copy files from to the 'destination' file, disk, or folder. Copy only data files if /D is included. CP Same as COPY command. CTTY [CON|AUX|PRN|MIDI] Change console to specified device. DATE [date|SHOW] Set/show date DEL file [...] Delete one or more files D [directory ...] [/P] [/W] [/F] DIR [directory ...] [/P] [/W] [/F] Display one or more directories. /P for printer output /W for wide output (4 entries/line) /F show free space on disk ECHO [ON|OFF|[@[option] ...] [#][text] Set/show echo mode or print 'text'. '#' allows leading blanks. Option format is: row column Position cursor Foreground color Set text foreground color Background color Set text background color Cursor [ON|OFF] Turn cursor on or off i.e. ECHO @10 10 @F 1 @BACK 0 @Cursor ON # Example ERA Same as DEL ERASE Same as DEL EXIT Same as BYE FOR %%v IN ( file [...] ) DO command Batch file command only. Perform command while substituting variable %%v, where 'v' is any character, while a 'file' is in the list. Names with wild card characters cause a directory to be searched. GEM [ON|OFF|command|:option] Set/show GEM mode for .PRG files. ON to run .PRG files as from desktop Optionally force any program 'command' to run from the desktop mode. 'option' has the following form: NOTE: SQUARE BRACKETS AND '|' ARE REQUIRED HERE. They do not imply an optional arguments. GEM :ALERT default [type][text][buttons] 'default' specifies the default button where no default is 0. The 'type' specifies the icon type (0 to 3, see GEM documenation). 'text' and 'button' items are separated by a '|'. Three 'button's max. The %:e, ERRORLEVEL, variable is set to the selected button (1 to 3) GEM :FILE [path] [file] presents the GEM file selector menu. 'file' may be blank. Results are in %:f for the file name and %:p for the path name, and %:d for drive letter. %:e is 0 if OK is selected and 1 if Cancel is selected. GEM :SELECT default [text][button] General button selection which can have more text and buttons than :ALERT but no icon option. 'text' can be as wide as the screen (less 2 characters). GEM :INPUT [text][valid] GEM :INPUT [text][valid|format] GEM :INPUT [text][valid|format|default] GEM :INPUT [text][valid|format|default|output] General single line text input menu. 'text' is like :ALERT and :SELECT and appears at the top of the menu. The text entered is place into %:i. The 'valid', 'format', 'default' and 'output' options control what can be entered. The 'valid' string can contain any of these: 9 digits 0 to 9 A uppercase letters and space a any letter and a space N uppercase letters, digits and a space n any letter, digits and a space F file name characters plus : ? * f file name characters plus : P path name characters plus : \ ? * p path name characters plus : \ X any character 'format' and 'output' specify where the actual text goes using '_' and all other characters are decoration. Examples: GEM :INPUT [An example:][XXXXXXXXXXXXXX] GEM :INPUT [Enter a date:][999999|__/__/__] GEM :INPUT [Enter a date:][999999|__/__/__|112288] GEM :INPUT [Enter a date:][999999|__/__/__||__-__-__] GOTO label Continue batch file execution after the line that starts with :label GOTO #number label [...] Computed GOTO based upon the value of 'number' where the first label is 0. Continue if there is no corresponding label. HELP Print list of built-in commands. IF [NOT] EXISTS file command IF [NOT] FOLDER folder command IF [NOT] ERRORLEVEL level command IF [NOT] s1==s2 command Execute 'command' if condition met. INPUT [#][prompt] Enter the interactive mode if no parameters, otherwise, print the 'prompt' and accept one line from the keyboard. A leading '#' will not be printed and allows for leading spaces. LOG [ON|OFF] Set/show LOG flag status. PCommand prints the program/batch file name when ON. MKDIR name [...] Create a new folder. MD name [...] Same as MKDIR. PATH [;|path] Set/show PATH list. Reset with ';'. The PATH is used to find program/batch files. 'PATH path' is in the environment list. PAUSE Display 'Press any key to continue' and wait. PRINT file [...] [/P] [/B] List 'file's on the printer. /P to paginate with form feed at 55 lines/page. /B print until the physical end-of-file. Default is includes control-Z too. PROMPT [prompt] Set/show PROMPT string which can include: $_ New line (CR/LF) $B Vertical bar $Cx Control character (control-x) $D Current date $G '>' character $H Backspace character $L '<' character $N Current default drive $P Current default path on default drive $T Current time $V TOS version number XX.YY $X '!' character QED file Create a new 'file' using simple line editor. End of file indicated by a RETURN only. REM comment Remark in batch file. REN old_name new_name Rename file. Works across directories. RENAME old_name new_name Same as REN command. RESERVE [size] Set/show reserve size. Normally for desk accessory version which can reserve a block of memory to run a second program in. 'size' is in kilobytes and the default is 0. RMDIR folder [...] Delete empty folder. RD folder [...] Same as RMDIR command. SET [keyword[=value] ...] Show/set/reset environment list parameter. Environment list can be accessed by applications. 'keyword' and 'value' can be any non-blank string. SHIFT [number] Batch file only. Shift parameter list by 'number' (default is 1). STACK Display execution stack. Useful from within INPUT or batch files. SWITCHAR [character] Show/set parameter character. Default is '/'. TIME [time|SHOW] Set/show current time. TOS command [parameters ...] Force 'command' to execute in TOS mode (no mouse). TYPE 'file' ... [/B] [/P] Type 'file's on screen /B and /P are same as in PRINT command. VER Display TOS version number VERIFY [ON|OFF] Set/show floppy disk verify flag VOL [drive:]... Show volume name of 'drive'. WRAP [ON|OFF] Set/show WRAP flag. Default is ON. Cursor will goto next line if ON and at end-of-line.