home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-16 | 48.8 KB | 1,453 lines |
-
-
-
-
- TCLI - TOS Command Line Interpreter
- -----------------------------------
-
- With the recent success of graphical user interfaces, many people have turned
- their backs on command-oriented interfaces. A significant number, however,
- still prefer the familiar MS-DOS-style command line interpreter (CLI); to these
- people, typing "DIR" is an instinctive and often subconscious reflex when they
- want to display a directory of the files on a disk. Window-oriented
- environments often hinder these users, as well as prohibit access to some
- functions that CLI users take for granted. The TOS Command Line Interpreter
- (TCLI) is a program for the Atari ST/STE/TT lines of computers that brings much
- of the functionality and familiarity of MS-DOS to the Atari world.
-
- To use TCLI, copy the files in this archive to a newly formatted disk, or to
- your hard drive. It is also suggested that you print out this documentation,
- for instruction now and for future reference. Now, go into the directory you
- just copied the files to and double-click on the file COMMAND.PRG. TCLI should
- now be up and running, and you should be presented with a prompt like "A>" or
- "C>" depending on where you ran the program from. At this point, you will be
- able to enter TCLI commands, which are described in detail below, or you can
- run an external program. First, however, we will describe the format of
- filenames as TCLI interprets them.
-
-
- FILENAME FORMAT
- ---------------
-
- The file structure of the Atari ST is very similar to MS-DOS. This was a smart
- move on Atari's part, as it facilitated porting of commercial software over to
- the ST. If you are familiar with MS-DOS, you may want to skip this section and
- move on to "Running External Programs" below.
-
- NOTE: Quotation marks are used throughout this documentation to clarify
- exactly what the user should enter at the TCLI prompt. The one
- exception is in the FIND command, in which quotes are a part of the
- command's syntax. In all other cases, the quotes are NOT to be
- typed by the user.
-
- For the following discussion, let's assume that your C drive has the following
- file structure:
-
- \ - root directory
- \FILES\ - subdirectory containing some files
- \FILES\SOURCE\ - source code
- \EXECS\ - executable programs
-
- The main (root) directory on the ST is referred to as "\"; for example, the
- root direcory on drive C is "C:\". All other directories are stored underneath
- the root directory. For example, a subdirectory called "FILES" under the root
- directory on drive C would be accessed as "C:\FILES\". The drive letter
- displayed at the prompt indicates what the current drive is. If the file(s)
- you want to access are on the current drive, you need not specify the drive
- letter or colon in the filename (i.e., "\FILES\" would access subdirectory
- "FILES" on drive C's root directory).
-
- The current drive described above is the drive displayed in the command prompt.
- To make another drive the current drive, simply enter the drive letter,
- followed by a colon (:), on a line by itself. For example, to make drive A the
-
-
-
-
-
-
-
-
- current drive, you would enter:
-
- A:
-
- on a line by itself. The command prompt should change to reflect the new
- current drive.
-
- Another important concept here is the current directory. This is the directory
- that is searched for all programs and data files, unless another path is
- specified. To display the current directory, enter the command "PWD" with no
- parameters at the prompt, and press RETURN. This will be the directory from
- which TCLI was started. If you now try to execute an external program, TCLI
- will look in this directory for it. Using our example file system above, if
- your current directory is "C:\FILES\", and you want to access a file in the
- SOURCE directory, you would use "C:SOURCE\MYFILE.DAT" to access it. This means
- 'On the C drive, use the current directory, move down to the subdirectory
- "SOURCE", and the file I want to access is called "MYFILE.DAT"'. If your
- current drive is C, then the above file could also be referenced simply as
- "SOURCE\MYFILE.DAT".
-
- Using this scenario, if you want to run a file called "MYFILE.PRG" in the
- "EXECS" directory, you would enter "C:\EXECS\MYFILE.PRG" at the command prompt.
- This is interpreted as 'Using drive C, start at the root directory, go into the
- "EXECS" directory, and execute the file called "MYFILE.PRG"'. Again, if drive
- C is the current drive, you could equivalently enter "\EXECS\MYFILE.PRG" to
- accomplish the same task.
-
- In summary, to reference a file in or below the current directory, do not enter
- a backslash (\) before the file specificier; to access a file that is not in or
- below the current directory, use a backslash followed by the path from the root
- directory. If the drive letter is not specified, the current drive is used.
-
- Two other directories that should be mentioned are "." and "..". These refer
- to the current directory and the parent directory, respectively. The current
- directory specifier is rarely stated directly, as it is implied in all cases in
- TCLI. However, the parent directory specifier is used to "back up" a
- directory, moving up to the parent of the current directory. For example, if
- the current directory is "\FILES\SOURCE", and you want to access a program
- called "PROGRAM.PRG" in the "FILES" directory, you could use "..\PROGRAM.PRG",
- instead of entering the complete path from the root directory.
-
-
- RUNNING AN EXTERNAL PROGRAM
- ---------------------------
-
- To run an external program, simply type the first part of the filename,
- followed by a space and any parameters for the command. For example, to run a
- program entitled "PROG.PRG" in the current directory, enter "PROG". TCLI will
- look for the file names ending in ".PRG", ".TTP", and ".TOS" to find the
- program you want to run. You can eliminate this search by specifying the
- extension as well (i.e., enter "PROG.PRG" at the prompt).
-
- The way TCLI decides what files to attempt to load first depends on the
- presence of parameters. If there are parameters present, TCLI first looks for
- the ".TTP" extension, followed by ".PRG" and finally ".TOS". If there are no
- parameters, TCLI looks first for a ".PRG" extension, then ".TOS", and finally
- ".TTP".
-
-
-
- TCLI - Page 2
-
-
-
-
-
- If the program you want to run is a .TOS or .TTP program, TCLI will not clear
- the screen before or after the program is run; this way, commands can be
- "added" to TCLI by simply writing the programs and giving them a .TOS or .TTP
- extension. The RAMdisk program VDISK.TTP supplied as part of TCLI is an
- example of such a program. As long as these programs rely on textual input and
- output, they will integrate themselves seamlessly into the TCLI environment.
- If you want the screen to be cleared before and after a .TOS or .TTP program is
- run, enter "/C" on the line as a parameter. Note that this is not a good idea
- if the program you are running has a "/C" option and you want to use that
- option, since TCLI will not pass the "/C" as a parameter to the executing
- program (this can be circumvented by specifying "/C" twice, once for TCLI and
- once for the other program).
-
- On the other hand, .PRG programs will generally corrupt the text display in
- many ways. Recognizing this, TCLI will always clear the screen before and
- after such programs run.
-
- Parameters passed through TCLI will be converted to upper-case, and will be
- placed in the command line buffer for the program being executed.
-
-
- OTHER GENERAL INFORMATION
- -------------------------
-
- TCLI is based on the MS-DOS command set, but it also has some aliases for each
- command that are shorter and easier to remember, and it also contains some UNIX
- command aliases (the format of the command still follows the MS-DOS prototype,
- however).
-
-
- INTERNAL COMMANDS
- -----------------
-
- This section contains descriptions of all of TCLI's internal commands. To
- execute an internal command, simply enter the command and any necessary
- parameters. Each command's syntax is described in its section. Necessary
- parameters are listed after the command, and optional parameters are listed
- within square brackets ([]); a "|" symbol is used to indicate that one
- parameter or the other should be specified, but not both. Filenames are
- indicated by "fname", pathnames by "path", and drive letters by "n".
-
- When filenames are used in TCLI commands, wildcards can be implied by the
- context in which the filenames are specified. If a filename ends in a
- backslash (\), wildcards are implied at the end of it. For example, if
- "\EXECS\" is specified as a filename, the actual filename that TCLI would use
- is "\EXECS\*.*". If, however, the filename "\EXECS" is specified, only the
- directory "\EXECS" would be interpreted as the filename.
-
- The commands are presented in alphabetical order, according to the MS-DOS alias
- (i.e., the directory command will be listed under DIR, not LS).
-
-
- Command: ATTRIB
- Function: Displays and modifies file attribute flags.
- Syntax: ATTRIB [+A|-A] [+H|-H] [+R|-R] [+S|-S] [path][fname]
- Aliases: ATTR, CHMOD
-
- The ST file system supports four user-modifiable flags for each file/directory.
-
-
- TCLI - Page 3
-
-
-
-
-
- ATTRIB allows you to modify these flags. The "+" sign indicates that the flag
- is to be set, and "-" indicates that the flag is to be reset.
-
- If no filename is specified, but flags are, TCLI assumes all files in the
- current directory on the current drive are to be modified. If no flags or
- filenames are specified, ATTRIB will display the attributes of the files in the
- current directory on the current drive. The format of the display is
-
- ahrs filename.ext
-
- where a, h, r, and s indicate the appropriate flags. If a letter appears next
- to a filename, it indicates that the corresponding flag is set; if, instead, a
- dash (-) appears, it indicates that the flag is not set.
-
- +A/-A: Archive Flag
- -------------------
-
- The first flag is the archive bit, which is reset every time a file is written
- to. This is useful when developing a project from a RAMdisk, or when you want
- to keep an updated copy of your source code on a floppy. For example, let's
- assume that a project is being developed on drive C, written in C. This
- project spans many files, which we would like to back up on a floppy whenever
- we change the source code. To begin, we would set the archive bits on all of
- our source files like this:
-
- ATTRIB +A C:\SOURCE\*.C
-
- At the end of our development session, we would use the COPY command to back up
- only those files that have been modified, by using this command:
-
- COPY C:\SOURCE\*.C A:\BACKUP\ /R
-
- This tells TCLI to copy all unarchived .C files from C:\SOURCE\ to the \BACKUP
- directory on drive A, and to reset the archive bits of those files that were
- successfully backed up. (See the COPY command description for more
- information)
-
- +H/-H: Hidden Flag
- ------------------
-
- The hidden flag determines whether the file specified should be visible to the
- normal directory search. If a file is hidden (+H), TCLI will not display it in
- its directory listing; however, it can still be accessed by TCLI commands, and
- by most other programs. The GEM desktop doesn't support the hidden flags, so
- these files will still appear in the desktop window.
-
- +R/-R: Read-only Flag
- ---------------------
-
- The read-only flag enables the user to write-protect the file(s) specified by
- setting the read-only bit. When a write is attempted to a read-only file, an
- "access denied" error message is returned. To regain write access to the file,
- you must reset the read-only bit.
-
- +S/-S: System File Flag
- -----------------------
-
- The system file flag, for all practical purposes, performs the same task as the
-
-
- TCLI - Page 4
-
-
-
-
-
- hidden flag. As with the hidden flags, the GEM desktop does not support the
- system file flags.
-
-
- Command: BG
- Function: Changes/displays the background color.
- Syntax: BG [color]
-
- The default color configuration of TCLI is white text on a black background.
- These colors can easily be changed to any of the 512 colors that the ST
- supports. The BG command is used to change the background, while FG is used to
- change the foreground (text) color (see below).
-
- BG accepts either a named color that is predefined within TCLI, or a
- three-character string of the form "RGB", where R, G, and B are digits between
- "0" and "7", inclusive. R, G, and B indicate level of the red, green, and blue
- color components, with "0" being the absence of that color, and "7" being the
- maximum presence of the respective color.
-
- The predefined colors that BG recognizes are as follows:
-
- Aqua Green
- Black LightBlue
- Blue Orange
- Brown Pink
- DarkBlue Purple
- DarkRed Red
- ForestGreen (Forest) White
- Gray (Grey) Yellow
-
- The names in parentheses indicate alternative names for the respective colors.
-
- If BG is executed without a parameter, it will display the current RGB
- settings.
-
- Examples:
-
- BG WHITE
- BG 777
-
- These two commands both set the background color to white. If the BG command
- were then executed without parameters, TCLI would display:
-
- BG = 777
-
-
- Command: BUFFER
- Function: Toggles keyboard buffering on/off.
- Syntax: BUFFER [ON|OFF]
-
- This command toggles the keyboard buffering. When it is OFF, TCLI intercepts
- all keyboard input, and provides protection against accidentally exiting TCLI
- by pressing CONTROL-C. However, keystrokes are not buffered; you have to wait
- until the current process is finished before you can enter the next command.
-
- When BUFFER is ON, the keyboard input is buffered, but pressing CONTROL-C while
- anything is being displayed on the screen will abort TCLI, with no questions
- asked.
-
-
- TCLI - Page 5
-
-
-
-
-
-
- Using BUFFER with no parameters displays the current setting.
-
-
- Command: CAPS
- Function: Turns the uppercase conversion of characters on/off.
- Syntax: CAPS [ON|OFF]
-
- This command allows you to change whether TCLI capitalizes your input or not.
- This can be useful when you're dealing with variables and don't care if the
- output of the ECHO command is capitalized or not.
-
- When CAPS is ON, all input is capitalized; when it's off, the command line
- parameters for certain commands (ECHO, etc.) is left unchanged.
-
- Using CAPS by itself displays the current setting.
-
-
- Command: CD
- Function: Changes the current working directory.
- Syntax: CD path
- Alias: CHDIR
-
- The CD command changes the current directory for the specified drive, or the
- current drive if none is specified. The current directory can be displayed by
- using the PWD command (see below), or by using the $P option in the command
- prompt (see PROMPT below).
-
-
- Command: CHKDSK
- Function: Displays information on the drive specified.
- Syntax: CHKDSK [n:]
-
- The CHKDSK command displays information about the disk specified, or the
- current disk. The first item it displays is the disk size; this is the total
- amount of storage space on the disk (in bytes). Next, it displays the number
- of hidden files, directories, and user files, as well as separate totals of the
- number of bytes in each of these groups. Next, the number of bytes available
- on the disk is displayed, and finally, the total amount of RAM in the computer
- and the total amount of free RAM available.
-
-
- Command: CLS
- Function: Clears the screen.
- Syntax: CLS
-
- The CLS command can be used to clear the screen. It is especially useful after
- a batch file has executed, to clean up the display.
-
-
- Command: COPY
- Function: Copies/moves files from one place to another.
- Syntax: COPY [n:][path]from [[n:][path]to] [/A|/R] [/M]
- Alias: CP
-
- The COPY command copies or moves files from one location to another. In the
- simplest case, one file is copied directly to another place:
-
-
-
- TCLI - Page 6
-
-
-
-
-
- COPY EXECS\FILE.DAT B:\
-
- When a single file is copied, it can also be renamed in the process:
-
- COPY EXECS\FILE.DAT B:\NEWFILE.DAT
-
- Wildcards may be specified in the source, but in this case, the destination
- must be ONLY a path name, so renaming is not possible:
-
- COPY EXECS\*.C B:\FILES\
-
- The following command will copy all files in the C:\EXECS directory to the
- current directory on the B drive:
-
- COPY EXECS\*.* B:
-
- By using the /A option, COPY will only copy files that do not have their
- archive bit set (see ATTRIB above).
-
- By using the /R option, COPY will only copy files whose archive bit is not set,
- but it will then set the archive bit if the copy was successful. If the /R
- option is used, the /A option does not have to be specified. For example, to
- archive all files under C:\SOURCE onto the current directory on drive B:,
- automatically flagging the archived files as archived, this command would be
- used:
-
- COPY C:\SOURCE\ B: /R
-
- The /M option is used to move files from one disk to another. The specified
- files are copied to the new disk, then deleted from the old one if the copy was
- successful. This option can be combined with the /A option, or, equivalently
- in this case, the /R option.
-
- The following example will move all .C files from C:\SOURCE to D:\SOURCE:
-
- COPY C:\SOURCE\ D:\SOURCE\ /M
-
-
- Command: CURSOR
- Function: Defines the flash rate for the cursor.
- Syntax: CURSOR [x] (where "x" is an integer between 1 and 255)
-
- To make the cursor flash, use the CURSOR command. By entering a number between
- 1 and 255, the cursor will start flashing at the desired rate (which depends on
- your monitor). The lower the number, the faster the cursor will flash. To
- stop the cursor from flashing, enter the CURSOR command with no parameters.
-
- NOTE: Sometimes there is a delay between the execution of this command
- and the actual change in the cursor's flash rate.
-
-
- Command: DA
- Function: Allows access to Desk Accessories.
- Syntax: DA
-
- This command allows you to access desk accessories. When you invoke DA, the
- screen is cleared, and a menu bar appears at the top of the screen. Run the
- appropriate desk accessory, then choose "Return to TCLI" to exit back to TCLI.
-
-
- TCLI - Page 7
-
-
-
-
-
-
-
- Command: DATE
- Function: Displays/sets the system date.
- Syntax: DATE [month-day-year]
-
- To display the system date, enter the DATE command with no parameters. To set
- the system date, specify the date in the format described above. The day and
- month can be any valid day and month, and the year can be in either a two-digit
- or four-digit format. The following two commands set the date to February 1,
- 1993:
-
- DATE 2-1-1993
- and
- DATE 2-1-93
-
-
- Command: DIR
- Function: Displays a directory of files on a disk.
- Syntax: DIR [n:][path][fname] [/P] [/W]
- Alias: LS
-
- To display a listing of the files on a disk (or in a directory), use the DIR
- command.
-
- The default directory will be displayed in a format that displays the filename,
- extension, size, and time and date of creation or last modification. This
- listing will be sorted first on the file's extension, and secondly on the
- filename. At the end of the directory, the number of files and the amount of
- free space on the disk are displayed.
-
- If a filename is specified, the directory will be scanned for files matching
- the filename; wildcards are, of course, permitted. Only files matching the
- specified name will be displayed. For example, the following command will
- display all filenames in C:\SOURCE\ ending in .C:
-
- DIR C:\SOURCE\*.C
-
- If the /P option is specified, the directory contents are displayed one
- screenful at a time. When the screen fills up, you will be told to press any
- key to continue; do so, and the next page will be displayed.
-
- If the /W option is specified, the directory is displayed in a compressed
- format. Only the filenames are displayed; directories are identified by a
- backslash (\) before their names.
-
-
- Command: ECHO
- Function: Turns batch command echo on or off; displays messages.
- Syntax: ECHO [ON|OFF|Message]
-
- The ECHO command is used to turn off or turn on the display of batch file
- commands as they are executed. To supress the display of batch file commands,
- use ECHO OFF; to resume display of the commands, use ECHO ON.
-
- If anything other than ON or OFF is passed into ECHO as a parameter, that
- string is displayed on the screen. If no parameters are specified, a blank
- line is printed. This can be useful in a batch file to keep the user updated
-
-
- TCLI - Page 8
-
-
-
-
-
- on what is happening; enter "ECHO ON" as the first line in the batch file, then
- use subsequent ECHO commands to display status information.
-
-
- Command: EDLIN
- Function: Allows the user to create a line-oriented text file.
- Syntax: EDLIN [n:][path]fname
- Alias: ED
-
- The EDLIN command can be used to create a short text file from within TCLI (to
- create large files or to edit existing files, use a full-fledged text editor).
- EDLIN will only accept lines up to 78 characters as input to the file. The
- current line can be edited by using BACKSPACE on that line; once RETURN is
- pressed, however, the line is added to the file. To end EDLIN, press RETURN on
- a blank line.
-
- If the file specified exists, you will be asked if you want to overwrite the
- file; enter 'Y' (or 'y') to overwrite it and create a new file, or anything
- else to abort EDLIN.
-
- EDLIN is of most use as a quick editor when creating short batch files or very
- small programs.
-
-
- Command: ERASE
- Function: Removes the file(s) specified from a disk.
- Syntax: ERASE [n:][path]fname
- Aliases: ERA, DELETE, DEL, RM
-
- To erase a file or group of files, use the ERASE command. ERASE does not
- prompt you before deleting files unless you are deleting all files on a disk or
- in a directory (i.e., "ERASE *.*"), so be sure that you do want to delete the
- files before you press RETURN.
-
- It is a good idea to have an "unerase" utility around, in case you do
- accidentally erase a file you need. If you do inadvertently erase a file, DO
- NOT write to the disk! If you write to the disk after deleting a file, the
- file will probably be rendered unrecoverable.
-
- If you attempt to erase all the files in a directory, ERASE will ask you if
- you're sure you want to do that. If you do, enter "Y" or "y", and the files
- will be erased; otherwise, the ERASE will be aborted.
-
-
- Command: EXIT
- Function: Returns to the program that called TCLI.
- Syntax: EXIT
- Aliases: QUIT, BYE
-
- To leave TCLI and return to the desktop (or whatever program called TCLI), use
- the EXIT command.
-
-
- Command: FG
- Function: Sets/displays the foreground (text) color.
- Syntax: FG [color]
-
- The FG command sets TCLI's text color. It works exactly the same as BG (see
-
-
- TCLI - Page 9
-
-
-
-
-
- above).
-
-
- Command: FIND
- Function: Searches the file(s) specified for the indicated search term.
- Syntax: FIND "string" [n:][path]fname
- Alias: GREP
-
- The FIND command is provided to search through line-oriented text files for a
- specific search term. Only the first 128 characters in each line is actually
- searched; this should pose no problem for the average text file.
-
- FIND displays each occurence of the search term in the file by displaying the
- line number and the line itself. It then displays the total number of
- occurences of the string in the file. The search is not case-sensitive, since
- FIND converts everything to upper-case as it searches for the string.
-
- By using wildcard characters, a group of files can be searched for the string.
- In this case, FIND displays the name of each file being searched, the lines in
- which the search term is found, the total number of occurences of the string
- within each file, and finally, the total number of occurences found within the
- group of files.
-
- As an example, suppose you want to search all Pascal source files in the
- current directory for the term "PROCEDURE". You would enter a command like
- this:
-
- FIND "Procedure" *.PAS
-
- It is often useful to redirect the output of the FIND command to a disk file or
- the printer. To redirect output to a file called "PROC.FND", for example, you
- would enter:
-
- FIND "Procedure" *.PAS >PROC.FND
-
- Having done that, you can browse through the file, display it using the TYPE
- command (see below), or print it out. See the section on I/O Redirection for
- information on how to do this.
-
-
- Command: FORMAT
- Function: Format a floppy disk.
- Syntax: FORMAT [n:] [/T:tracks] [/N:sectors] [/1]
-
- The FORMAT command is used to format a floppy disk. By specifying the number
- of tracks (80-82) and the number of sectors per track (9-11), you can generate
- a variety of disk formats for the ST. The default format uses both sides of
- the disk, 80 tracks, and 10 sectors per track, yielding approximately 800K of
- storage space per disk. These defaults can be changed by using the "/T:"
- option to specify tracks, "/N:" to specify sectors per track, and "/1" to force
- a single-sided format. For example, to format a disk in drive A to 80 tracks,
- 9 sectors per track, single sided, you would enter:
-
- FORMAT A: /N:9 /1
-
- To format the same disk to double-sided, simply leave off the "/1":
-
- FORMAT A: /N:9
-
-
- TCLI - Page 10
-
-
-
-
-
-
- To format a disk to 81 tracks, 11 sectors per track (not a recommended format,
- but possible), use the following:
-
- FORMAT A: /T:81 /N:11
-
- Be aware that formatting a disk will erase everything on it. To help guard
- against this, TCLI will prompt you when you try to format a disk.
-
-
- Command: FREE
- Function: Toggles the display of disk free space for DIR command.
- Syntax: FREE [ON|OFF]
-
- This command allows you to turn off the display of free space in the DIR
- command. When you execute the DIR command, the amount of free space left on
- the disk is displayed. This causes a delay while the computer tries to figure
- out how much space is left, especially if the disk is a floppy. Turn this
- feature off with the FREE OFF command.
-
- If FREE is invoked with no parameters, the current setting is displayed.
-
-
- Command: GOTO
- Function: Goes to a specified line in a batch file.
- Syntax: GOTO label
-
- This command, executable only from within a batch file, transfers execution of
- the batch file to the specified label. The label must exist somewhere in the
- batch file, on a line by itself, preceded only by a colon (":").
-
- In the following batch file, the ECHO statement is never executed:
-
- REM Batch file starts here...
- GOTO CONT
- ECHO This is never displayed.
- :CONT
- REM Batch file continues here...
-
- Obviously, this command is most useful with a conditional statement (see the IF
- command, below).
-
-
- Command: IF
- Function: Allows conditional execution of commands.
- Syntax: IF [NOT] expression command
-
- This command, only available from within batch files, allows the batch file to
- conditionally execute commands.
-
- The "expression" statement must be one of these two forms:
-
- string1==string2
- or
- exist filename
-
- For example, the COPY command below is executed ONLY if the source file exists,
- and the destination file doesn't exist:
-
-
- TCLI - Page 11
-
-
-
-
-
-
- if not exist c:file.dat goto no_copy
- if exist a:file.dat goto no_copy
- copy c:file.dat a:
- goto continue
- :no_copy
- echo Error - Source doesn't exist, or destination does exist.
- :continue
- rem Batch file continues here.
-
- You can also compare strings with IF, which will substitute any variables that
- are included:
-
- :loop
- echo 1. ST-Writer
- echo 2. Personal Pascal
- echo 3. Laser C
- echo 4. Quit
- echo
- echo Enter your choice:
- read c
- if %C==1 goto do_stwriter
- if %C==2 goto do_pascal
- if %C==3 goto do_laserc
- if %C==4 goto end
- echo Bad choice! Try again.
- goto loop
- :do_stwriter
- cd \stwriter
- stwriter
- goto loop
- :do_pascal
- cd \pascal
- pascal
- goto loop
- :do_laserc
- cd \laser_c
- laser
- goto loop
- :end
- echo Later, dude!
-
- Note that the variable name "C" MUST be capitalized when the CAPS option is
- turned off; if CAPS is ON, there will be no problem if it is not capitalized,
- since TCLI will capitalize it for you.
-
-
- Command: LC
- Function: Returns a line count of the file(s) specified.
- Syntax: LC [n:][path]fname
-
- The LC command can be used to count lines in text files. This is useful when
- developing a large project that spans several files; you can simply use the
- command
-
- LC *.C
-
- to count the number of lines of source code you have in your project. LC will
-
-
- TCLI - Page 12
-
-
-
-
-
- display line counts for each file matching the filename, then it will give a
- cumulative total at the end.
-
-
- Command: LET
- Function: Assigns a value to a variable.
- Syntax: LET x=[string]
-
- This command allows a variable to be changed. There are twenty-six available
- variables, the letters A through Z. It doesn't matter in the LET command
- whether the variable name is capitalized. However, it DOES matter when the
- variable name is used elsewhere.
-
- The following batch file illustrates the use of the LET command.
-
- echo What's your first name?
- read f
- echo What's your last name?
- read l
- let n=%F %L
- echo Your name must be %N!
-
- Notice that when the variables are referenced, they MUST be capitalized.
-
- Variables are global; once they are set to a value, other batch files can
- access the variable's value. This is a convenient way to pass values back and
- forth between batch files.
-
-
- Command: MKDIR
- Function: Creates a directory.
- Syntax: MKDIR [n:][path]dirname
-
- To create a directory on a disk, use the MKDIR command. Give the new directory
- name as a parameter, and, if possible, the new directory will be created on the
- drive specified, or on the current drive, if none is specified.
-
-
- Command: MODE
- Function: Switches between low and high resolution.
- Syntax: MODE [40|80]
-
- If you will be using a low-resolution drawing program, or any other program
- that only runs in low resolution, you will have to switch to low resolution at
- the desktop, then run TCLI. But a command line interpreter is not well suited
- to a 40-column display; the screen tends to get cluttered, and text files can't
- be viewed correctly. TCLI solves this problem by enabling you to switch to
- another resolution, without changing the "actual" resolution of the system. To
- do this, use the desktop to switch to low resolution. Next, run TCLI, and
- enter this command:
-
- MODE 80
-
- When you do, the screen should be switched to high resolution. But the ST is
- not really in high-res mode; only text-based .TOS and .TTP programs will run in
- high resolution. .PRG programs will revert back to low resolution, so you
- could then run your drawing package, then exit back to TCLI in high
- resolution.
-
-
- TCLI - Page 13
-
-
-
-
-
-
- You can also switch to low resolution from high by entering "MODE 40", but all
- .PRG programs will still execute in high resolution.
-
-
- Command: MORE
- Function: Displays a text file, one screenful at a time.
- Syntax: MORE [n:][path]fname
- Aliases: PG, PAGE
-
- The MORE command allows the user to view a text file, one screen at a time.
- When the screen fills up, a message telling you to strike a key will appear.
- Press any key, and more of the file will be displayed.
-
-
- Command: PATH
- Function: Specifies a path to be searched for programs.
- Syntax: PATH [path;][path;]...[path]
-
- When an unknown command is entered into TCLI, it looks in the current directory
- for the file. If it is not found there, it will search through the directories
- contained in PATH to find the program.
-
- PATH defaults to ";", which is the null path, indicating that no path other
- than the current one should be checked. If you have a directory called EXECS
- on drive C, in which some executable programs are stored, you can enter
-
- PATH C:\EXECS\
-
- and TCLI will search that directory every time it fails to find a program in
- the current directory. If you have several directories, you could enter:
-
- PATH C:\EXECS\;C:\FILES\
-
- Each of these directories will be searched when a program is not found in the
- current directory.
-
- If you have an existing path and would like to append directories to it, enter
- a semicolon (;) before the first path in it. For example, if we had executed
- the last example above, and we wanted to add "C:\EDITORS\" to our search path,
- we would enter
-
- PATH ;C:\EDITORS\
-
- and our path would now be
-
- C:\EXECS\;C:\FILES\;C:\EDITORS\
-
- If you will always be working with one drive, you can omit the drive letters
- and colons from the path names; however, if you will be using other drives, it
- is a good idea to leave the drive names in place. This is because, if no drive
- is specified, TCLI will search through the PATH directories using the current
- drive; if another drive is made to be the current drive, then the paths
- probably won't exist there, and you'll get an error message.
-
- To display the current PATH, enter PATH with no parameters.
-
- NOTE: Although programs can be executed from the alternate paths, their
-
-
- TCLI - Page 14
-
-
-
-
-
- resource files, data files, etc., can only be accessed if they are
- in the CURRENT directory.
-
-
- Command: PAUSE
- Function: Pauses a batch file, asking the user to press a key.
- Syntax: PAUSE
-
- This command enables a batch file to stop execution, and wait for the user to
- press any key. When the user presses a key, the batch file continues where it
- left off.
-
-
- Command: PRINT
- Function: Print a file on the printer.
- Syntax: PRINT filename
-
- This command prints the specified file on the printer. It is functionally
- equivalent to "TYPE filename >PRN:"
-
-
- Command: PROMPT
- Function: Changes the command prompt.
- Syntax: PROMPT [string]
-
- The PROMPT command enables the user to customize the TCLI prompt. The default
- prompt is the current drive followed by a greater-than sign (">"), but PROMPT
- allows this to be modified to include the time, date, current path, and other
- items.
-
- The prompt string can contain any text the user wants; the following control
- characters serve special purposes and display the data indicated:
-
- $b "|" character
- $d Date
- $e ESC
- $h Backspace
- $g ">" character
- $l "<" character
- $n Current drive
- $p Current directory
- $q "=" character
- $t Current time
- $v TCLI version
- $$ "$" character
- $X CR/LF (where "X" is any character other than those listed above)
-
-
- If no string is specified, the prompt is reset to the default string.
-
- PROMPT Examples:
- ---------------
-
- Prompt String Prompt Displayed
- ------------- ----------------
-
- $n:$p\ C:\CURRENT\PATH\
- $p$g \CURRENT\PATH>
-
-
- TCLI - Page 15
-
-
-
-
-
- It's $t, okay? It's 1:30:10 PM, okay?
- It's $t on$x$d. The current$x It's 1:30:10 PM on
- path is $n:$p\ $g 7-20-1992. The current
- path is C:\CURRENT\PATH\ >
-
- By using "$e" (ESC) in the command line, you can access the ST's built-in VT52
- emulator routines. To see "$e" in action, try the following command:
-
- prompt $ej$eH$epDrive: $n: Path: $p\ Time: $t Date: $d$eK$eq$ek==$g
-
- This command changes the command prompt to display the current drive, path,
- time and date at the top of the screen, in reverse video. It works like this:
- "$ej" saves the current cursor position, "$eH" takes the cursor to the home
- position, without clearing the screen, and "$ep" causes all text to be
- displayed in reverse video. The text string, along with the PROMPT variables,
- is then displayed. "$eK" clears the rest of the line, "$eq" restores normal
- video output, "$ek" returns the cursor to its saved position, and the prompt
- that is displayed is changed to "==>".
-
-
- Command: PWD
- Function: Displays the current directory.
- Syntax: PWD [n:]
-
- To display the current directory of a disk drive, use the PWD command. This is
- of most use when you don't have the prompt set up to display the current
- working directory.
-
-
- Command: READ
- Function: Allows a batch file to read input from the user.
- Syntax: READ x
-
- This command reads input from the user, from within a batch file. It assigns
- whatever the user enters to the variable specified; variables are simply
- letters of the alphabet. When used with the READ command, variable names do
- not have to be capitalized.
-
- Variable names are global, so once a variable has been set, other batch files
- can use the same variable, with its contents unchanged.
-
- Command: RENAME
- Function: Renames a file.
- Syntax: RENAME [n:][path][fname]
- Aliases: REN, MOVE, MV
-
- The RENAME command allows the user to rename a file on disk. Wildcards are not
- allowed; only one specific file can be renamed at one time.
-
- For example, the following command renames the file "C:\PATH\FILE.DAT" to
- "NEWFILE.DAT":
-
- RENAME C:\PATH\FILE.DAT NEWFILE.DAT
-
- Note that the second filename does not need the drive or path specified to
- perform a rename.
-
- The RENAME command can also be used to move a file from one directory to
-
-
- TCLI - Page 16
-
-
-
-
-
- another. To do this, simply specify the destination path (with respect to the
- current directory) along with the second filename. Even in this case, the
- second filename is REQUIRED! The following command moves the file "FILE.DAT"
- from \PATH\ to \NEWPATH\FILES\:
-
- MV \PATH\FILE.DAT \NEWPATH\FILES\FILE.DAT
-
- The file can easily be renamed in the course of a MOVE:
-
- MV \PATH\FILE.DAT \NEWPATH\FILES\NEWFILE.DAT
-
- This command can not be used to move files between disks; see the COPY command
- for details on how to do that.
-
-
- Command: RMDIR
- Function: Deletes an empty directory.
- Syntax: RMDIR [n:][path][dirname]
-
- The RMDIR command allows the user to delete empty directories. If this command
- is attempted on a directory that contains files, an error (access denied) will
- be returned.
-
- For example, to remove a directory called "C:\FILES\SUBDIR", enter:
-
- RMDIR C:\FILES\SUBDIR
-
-
- Command: SUBST
- Function: Allows the substitution of paths by drive letters.
- Syntax: SUBST [n:] [[n:]path]
-
- The SUBST command allows the user to replace commonly used path names by a
- simple drive letter. For example, suppose a user wants to easily access files
- under a directory called "\SOURCE\FILES\" on drive C. The following command
- could be entered:
-
- SUBST Z: C:\SOURCE\FILES\
-
- and from then on, the files under that directory could be accessed as Z:fname.
- If a file called "FILE.DAT" existed under this directory, it could then be
- accessed as "Z:FILE.DAT". The command
-
- COPY Z:FILE.DAT B:
-
- would copy the file C:\SOURCE\FILES\FILE.DAT to the current directory on drive
- B:.
-
- The substitutions are performed internally by TCLI, before parameters are
- passed to the called program. This way, if the filename "Z:FILE.DAT" is
- entered as a parameter to an external program, the actual filename (i.e.,
- "C:\SOURCE\FILES\FILE.DAT") would be passed to the program. Substitutions are
- not valid within any called programs, however; a "drive not valid" error will
- likely be returned if an attempt is made to access a SUBSTituted drive.
-
- If no drive is specified, the current drive is inserted into the substituted
- filename.
-
-
-
- TCLI - Page 17
-
-
-
-
-
- The CD command can not be use with a SUBSTituted drive; using it shouldn't
- cause any problem, but no error indicating that it failed will be returned.
-
- To release a substituted drive, simply enter "SUBST n:".
-
- To display a list of SUBSTituted drives/paths, enter SUBST with no parameters.
-
-
- Command: TIME
- Function: Displays/sets the current time.
- Syntax: TIME [[h]h:mm[:ss] [AM|PM]]
-
- The TIME command is used to set the computer's internal clock. At least one
- "hours" digit is necessary, as well as both "minutes" digits; seconds are
- optional, as is an AM/PM designation. If neither AM nor PM is specified, the
- time is interpreted in a twenty-four hour format. Examples:
-
- TIME 1:30 PM
- TIME 01:30:00 PM
- TIME 13:30
- TIME 13:30:00
-
- All four of these commands set the clock to 1:30 PM.
-
- If TIME is entered with no parameters, the current time is displayed, and the
- user is prompted for the current time. To change the time, enter the new time;
- otherwise, press RETURN, and the time will not be modified.
-
-
- Command: TREE
- Function: Displays a directory tree of the disk/directory specified.
- Syntax: TREE [n:][path] [/F]
-
- The TREE command is used to display a visual interpretation of the directory
- structure on a disk. If no drive is specified, the current drive is used. If
- no path is specified, the tree display begins with the current path on the
- drive being scanned.
-
- By default, the TREE command will display only the directories that it
- encounters during its disk traversal. To force TREE to also display files
- contained in the directories, specify the "/F" option.
-
- This command displays the directory structure under the current directory on
- drive C:
-
- TREE C:
-
- This command displays drive C:'s entire directory structure, regardless of the
- current directory:
-
- TREE C:\
-
-
- Command: TYPE
- Function: Displays a file on the screen.
- Syntax: TYPE [n:][path][fname]
- Alias: CAT
-
-
-
- TCLI - Page 18
-
-
-
-
-
- The TYPE command is used to display the contents of a text file. Wildcards can
- be specified; each file matching the wildcard specification will be displayed
- on the screen.
-
-
- Command: VER
- Function: Display the version of TCLI.
- Syntax: VER
-
- The VER command simply displays the version number of TCLI, and the amount of
- installed and free RAM on your computer.
-
-
- Command: VERIFY
- Function: Toggles the Write Verify feature on/off.
- Syntax: VERIFY [ON|OFF]
-
- By default, when the ST writes a sector to a disk, it immediately reads that
- sector back into memory, and compares it to the one it just wrote. If they
- match byte for byte, then the sector was successfully written. This is the
- ST's way of verifying that files are correctly written to the disk. Bad
- sectors are, fortunately, a rare occurrence.
-
- The TOS Command Line Interpreter offers you the option to turn off the
- write-verify feature, which will result in noticeably faster disk writes, at
- the expense of some reliability. Since disk write errors are so rare, turning
- write-verify off can usually result in better productivity.
-
- To turn off write-verify, use the command VERIFY OFF; to turn it back on, enter
- VERIFY ON.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- TCLI - Page 19
-
-
-
-
-
- OTHER FEATURES
-
- I/O Redirection
- ---------------
-
- TCLI supports output redirection for each command it can execute. When
- redirection is activated, all output that would normally go to the screen will
- be sent to the specified file/device instead. When the command has completed
- execution, output will be directed back to the screen.
-
- To specify output redirection, use the greater-than sign (">"), followed
- immediately by a filename:
-
- dir *.txt >c:\dir.lst
-
- This command will display a directory of all of the files in the current
- directory that end with ".txt", and redirect that listing to the file "dir.lst"
- on the root directory of drive C.
-
- If you would like to send output to the printer instead of a file, use PRN:
- instead of the filename:
-
- dir *.txt >prn:
-
- will send the same directory listing as above to the printer.
-
- Input redirection is supported only in the form of batch files. Batch files
- are identified by the ".BAT" extension, and consist of a set of commands to
- execute when the batch file is called. Batch files may be passed up to nine
- parameters, each of which can be accessed within the batch file as %n, where
- "n" is the parameter number.
-
- For example, suppose the following lines were contained in a batch file called
- "MAKE.BAT":
-
- cc %1.c -o %1.o -i\includes\headers\
- link -o %1.prg \includes\init.o %1.o
-
- This batch file will compile and link the file specified (this is an arbitrary
- C compiler - this batch file would most likely need to be modified before it
- could be used). To call this batch file to compile and link the program
- PROG.C, the following would be entered on the command line:
-
- make prog
-
- and the batch file will substitute the filename into the correct places in both
- the compile and link commands. Note that if the compile fails, no object file
- should be produced, so the linker would simply abort the link operation.
- Otherwise, the object file would be linked, and an executable named "PROG.PRG"
- would be produced on the current drive.
-
- When using batch files, it is important that all instructions, including the
- last one in the file, be followed by a carriage return. Otherwise, TCLI will
- not read in the entire command line, and an error will usually result.
-
- When TCLI is run, a special batch file called "AUTOEXEC.BAT" is searched for in
- the directory from which TCLI was started. If one is found, it is loaded and
- executed before control is returned to the user. This can be used to set up
-
-
- TCLI - Page 20
-
-
-
-
-
- the environment before you start a working session with TCLI. For example, the
- following batch file, if named AUTOEXEC.BAT, will switch to 80-column mode,
- create a RAMdisk, copy all of the files in the C:\FILES\ directory to the
- RAMdisk, set the attributes of the copied files to "archived," and finally
- clear the screen (to clean up the display):
-
- echo off
- mode 80
- echo Setting up RAMdisk as drive G:...
- vdisk g 800
- cp c:\files\ g:
- attr +a g:*.*
- echo on
- cls
-
- After this file has executed, you could edit the files on the RAMdisk, then use
- COPY with the /A or /R option to copy only those files that were changed back
- to drive C:; this could also be done with another batch file (let's call it
- SAVE.BAT):
-
- copy g:\ c:\files\ /r
-
- You could then enter "SAVE" as a command, and your modified files will be
- written back to the hard disk. This batch file will also reset the archive
- bit, so that if you make any other changes to the files, you can simply
- re-execute the SAVE batch file, and it will copy only those files changed since
- the last SAVE.
-
-
- Control Keys
- ------------
-
- TCLI supports the three major control keys for text displays: ^S, ^Q, and ^C.
- By pressing CONTROL-S, the user can halt the screen display, to read what's on
- the screen before it scrolls off; CONTROL-Q continues the display. CONTROL-C
- will stop the display entirely.
-
-
- RAMdisk
- -------
-
- TCLI includes a short RAMdisk program called "VDISK.TTP". It can be run from
- the desktop, but was intended for use mainly with TCLI.
-
- To set up a RAMdisk, enter the following command:
-
- vdisk n size
-
- where "n" is an unused drive letter and "size" is the size of the RAMdisk, in
- kilobytes. If the RAMdisk was set up successfully, you will be told so; if
- not, you will be alerted to the problem.
-
- Once set up, the RAMdisk acts like any other disk drive, only much faster.
- Files can be written to it and read from it. However, since the files are
- stored in RAM, you should not rely on it to store important files. If you do,
- you should periodically back those files up to a real disk.
-
- To use VDISK.TTP from the desktop, double-click on VDISK.TTP. Then enter "n
-
-
- TCLI - Page 21
-
-
-
-
-
- size" when the dialog box appears, and press RETURN. After the program
- executes, click once on an existing drive icon, then select "Install Disk
- Drive" from the "Options" menu. A dialog box will then appear; change the
- drive letter displayed to the drive letter that you named the disk drive, and
- click on "Install". Your new disk icon will appear on the desktop, where it
- can be accessed just like the other disks.
-
- If you install the disk drive from within TCLI, then return to the desktop, the
- disk drive will still exist, and you can perform the above steps to install the
- disk icon, starting with clicking an existing drive icon.
-
- By re-executing VDISK.TTP, you can install multiple RAMdisks. As long as they
- are given different drive letters, and you have enough free RAM, the drives
- will install and operate properly.
-
- The RAMdisks installed by the VDISK program will remain in memory until you
- turn the power off or reboot the computer.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- TCLI - Page 22
-
-