home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-01-14 | 122.0 KB | 4,301 lines |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- IBM Personal Computer (R) Virtual Teaching Language Interpreter
-
- Reference Manual
-
- July, 1983
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 1
-
-
-
-
-
-
-
-
-
- Table of Contents
-
- Introduction...........................................3
- Installation of the Interpreter........................4
- Features of the Interpreter............................6
- Commands and Syntax....................................8
- TYPE command......................................10
- ACCEPT command....................................11
- MATCH command.....................................12
- JUMP command......................................13
- USE subroutine command............................14
- RETURN from subroutine command....................15
- END command.......................................16
- CALCULATE command.................................17
- HARDCOPY command..................................18
- OPEN file command.................................19
- eXIT (close) file command.........................20
- GET (read) from file command......................21
- PUT (write) to file command.......................22
- LINK (chain program) command......................23
- INSERT (in comparison register) command...........24
- FRAME (text display) command......................25
- YES-IF (comparison) command.......................26
- DO (execute file) command.........................27
- WAIT (for keystroke) command......................28
- ZERO (registers) command..........................29
- Advanced Commands......................................30
- Display modes.....................................30
- VIDEO control commands............................31
- VIDEO COLOR command...........................32
- VIDEO LOCATE command..........................34
- VIDEO SELECT command..........................35
- SCREEN graphics commands..........................36
- SCREEN DRAW command...........................38
- SCREEN CIRCLE command.........................40
- SCREEN SET and RESET commands.................41
- SCREEN PAINT command..........................42
- SCREEN LINE command...........................43
- KEY (function key) command........................44
- BEEP (sound) command..............................45
- QUICKMOVE (graphics load/dump) command............47
- NEWDISPLAY (adapter select) command...............48
- Use of Interpreter and Programming Examples............49
-
- Appendix A--Error Messages.............................57
- Appendix B--Extended String Registers..................60
- Appendix C--Intermixing Text and Graphics..............61
- Index..................................................62
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 2
-
-
-
-
-
-
-
-
-
- Introduction
-
- This manual describes how to use the Virtual Teaching
- Language interpreter. The first section covers installation of
- the interpreter. The second section explores the features of
- the interpreter. The third section explains the commands
- available in this implementation of the PILOT language. The
- fourth section demonstrates some examples of how the commands may
- be used to create interactive courseware for computer-aided
- instruction (CAI).
- The manual assumes that the reader is at least slightly
- familiar with PC-DOS(R) and has learned how to use either the DOS
- line editor or a word-processing program to create text files.
- No other knowledge is directly required to use either this manual
- or the interpreter.
- Virtual Teaching Language (VTL) was written in DOS advanced
- BASIC, and is distributed in machine-readable form as the file
- VTL.EXE, except to those users who have purchased a source
- license. This manual, the interpreter, and source code are
- copyrighted material, under the protection of Federal Law.
- The program and manual are being distributed as 'share-ware' via
- computer clubs and public domain libraries. Anyone wishing to
- make use of VTL may do so for non-commercial purposes, and may
- copy and distribute the program without restrictions other than
- this. Persons wishing to distribute VTL for commercial uses
- (i.e. as part of a proprietary teaching package) may do so under
- license from the author for a nominal fee. Users are encouraged
- to register with the author. The registration fee is $25.00 US
- for non-commercial users. This money will be used to defray the
- costs of continued support and improvement of the VTL language.
- Registered users are entitled to support via written
- correspondence to the address listed below, and will also receive
- notice of improved releases of VTL (and other products from
- Nuclear Software. Unauthorized (e.g. commercial) copying or
- resale of the program or manual is a violation of Federal Law,
- and may be punishable by imprisonment for up to one year, and by
- a fine of up to $5000.
- VTL.EXE is a stand-alone executable file, and does not
- require the IBM BASIC Compiler (R) run-time system BASRUN.EXE.
- VTL.EXE requires at least 64K of RAM for safe operation, and may
- require 96K to execute programs with many long labels. VTL.EXE
- may be run safely on single-sided single-disk systems, and
- requires a lineprinter only for "HARDCOPY" commands, which may,
- however, cause an error if a lineprinter is not present or "on-
- line".
- This version of the interpreter is designed for users of
- either the IBM monochrome-printer adapter or the color display
- adapter in text or graphics mode. The interpreter recognizes
- which adapter is currently in use, and also tests for the
- presence of the other adapter. If both adapters are present, a
- Virtual Teaching Language program may use either via a built-in
- command, and can tell which is present.
- Users who are not familiar with the PILOT language may find
- the fourth section of this manual helpful as initial reading
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 3
-
-
-
-
-
-
-
-
- before diving into the remainder of the material presented here.
- More experienced users may wish to begin by reading the reference
- section, and then refer to the last section for examples.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 4
-
-
-
-
-
-
-
-
-
- I. Installation of the Interpreter
-
- No specific procedure, apart from copying the material
- distributed, is required for installation of VTL.EXE.
- The interpreter is packaged with the manuals on one double-
- sided diskette. The diskette contains both manuals and program
- examples, in addition to two versions of the interpreter. The
- first version, VTL.EXE is for the IBM-PC/XT (R) and compatible
- computers; the other, VTLJR.EXE, is for the PC-Jr. (R).
- The user should immediately make at least one backup copy of
- the distributed material. To do so, follow this procedure:
-
- 1) Insert a DOS diskette containing the files DISKCOPY.COM
- and DISKCOMP.COM in disk drive A (the left-hand drive).
-
- 2) Type DISKCOPY A: B: and press ENTER.
-
- 3) Insert the distribution diskette in drive A, and a blank
- diskette in drive B (the right-hand drive). If you have only one
- drive, insert the distribution diskette.
-
- 4) Press any key. The copy procedure will begin. If you
- have only one drive, the DISKCOPY program will periodically
- instruct you to insert the blank diskette alternately with the
- distribution diskette.
-
- 5) When copying is complete, press the N key. Then replace
- the distribution disk in drive A with the disk holding the
- DISKCOMP program. Type DISKCOMP A: B: and press ENTER.
-
- 6) Replace the diskette in drive A with the distribution
- disk. Press any key. A comparison of the original and copied
- diskettes will be performed. If you have only one diskette
- drive, you will again be instructed to alternate diskettes. If
- the diskettes 'compare OK' then remove the previously blank
- diskette and label it.
-
- No special installation procedure is needed for the
- interpreter itself. Users of DOS V2.0 with the IBM fixed disk
- may copy the interpreter into a fixed disk partition. However,
- DOS V2.X users should be aware that the interpreter can access
- program and data files ONLY within the current directory. The
- interpreter and its related files should therefore be listed in
- the same directory on fixed disk, and are best listed in the
- root directory (\) on diskette, if possible.
- The user may wish to make additional copies of the manual,
- and may do so as follows:
-
- 1) Make sure that the lineprinter has an ample supply of
- paper. The manual is a LONG document!
-
- 2) Insert a diskette holding the manual in drive A.
-
- 3) Type COPY A:VTL.TXT LPT1: and press ENTER to print a
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 5
-
-
-
-
-
-
-
-
- copy of the manual.
-
- The manual is distributed as ordinary text (in DOS form).
- The manual was written using WORDSTAR (R), and users with a
- source license may obtain a copy in WORDSTAR compatible form for
- modification.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 6
-
-
-
-
-
-
-
-
-
-
- II. Features of the Interpreter
-
- Virtual Teaching Language is a new dialect of the PILOT
- instructional language. Standard PILOT is designed to display
- information on a screen, ask questions, and get responses. The
- responses are matched against phrases defined by the programmer.
- Depending on whether or not a match is found, subsequent commands
- may or may not be executed.
- Most standard PILOT interpreters required that the program
- to be executed be loaded into main memory along with the inter-
- preter, thus constraining program size. Virtual Teaching Language
- reads the program line by line from disc, and thus, program size
- is limited only by disc capacity. In addition, Virtual Teaching
- Language permits one program to chain another while passing
- considerable amounts of data to the next program, thus removing
- even this constraint. This feature may cause brief pauses in
- execution, if a jump is made to a statement just preceding the
- current statement in a long program. However, an additional
- feature permits loading of screenfulls of data from a second
- file, which cuts program length considerably. Virtual Teaching
- Language also permits execution of other files as subroutines,
- permitting structuring of a program into a string of procedures.
- Multi-command lines are also supported. These advanced features
- permit development of terse, modular, almost fully structured
- program code, which may be entirely separate from the course
- material it is designed to present.
- When initiated, Virtual Teaching Language tries to execute a
- program named "autoexec.vtl". If this program is not present,
- the interpreter asks for the name of the program to be executed.
- A menu or instructional program may be named "autoexec.vtl", and
- will thus be executed automatically whenever the interpreter is
- run.
- In addition to the standard PILOT commands to print a line,
- ask a question, match phrases, jump to a new line, run a subrou-
- tine, return from a subroutine and end execution, and the frame-
- loading and chaining commands mentioned above, Virtual Teaching
- Language includes commands to perform limited numerical and text
- manipulations, read from and write to a disk file, specify a
- string to be matched against phrases, and print data on a
- lineprinter. All of these commands may make use of 'registers'
- built into the interpreter--temporary storage areas which may be
- used for calculations, and whose contents are automatically
- inserted into command lines where appropriate. Twenty-six
- registers for each of three data types--integer, real, and
- string--are provided. The use of registers permits indirect
- command addressing and indexed jumps, as well as embedded
- calculation of scores, execution checkpoints, and implementation
- of interruptable and resumable programs. An additional 26
- extended string registers give the programmer access to the date
- and time, the current program name, the current line number, and
- several other useful quantities.
- VTL.EXE provides commands for performing comparisons between
- expressions, loading and display of Function Keys, timed pauses
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 7
-
-
-
-
-
-
-
-
- until a key (or Function Key) is struck, control of character
- display modes for both the monochrome and color display systems,
- and directed location of the cursor on the screen. The
- interpreter also provides color graphics if a color adapter is
- present, as well as sound, loading of full graphics screens with
- a single command, and switching between monochrome and color
- display adapters, if both are present. These last features are
- extremely machine-dependent (i.e., they will work with the IBM
- Personal Computer, but may well not work with another
- 'compatible' machine).
- Virtual Teaching Language provides intelligible error
- messages, using error trapping for illegal file accesses, in
- addition to intercepting syntax and calculation errors.
- Unexpected system errors are also trapped and reported--a feature
- useful for users with source licenses who wish to modify the
- interpreter themselves.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 8
-
-
-
-
-
-
-
-
-
- III. Commands and Syntax
-
- Virtual Teaching Language programs are text files, resident
- on disc, which have been created by a text editor. Each line in
- such a file is read by the interpreter. If more than one command
- is present in a given line, each command is interpreted in turn.
- Multiple commands in a single line are separated by backslash (\)
- characters. A command may be treated as:
-
- 1) a comment, which begins with "!" (an exclamation
- point), and which is ignored;
- 2) a label, which begins with "*" (an asterisk), which
- must be the first command in a multi-command line, and
- which may be used as the target of a JUMP command;
- 3) a directive to be executed.
-
- A command has the following structure:
-
- [identifier][modifier][:][expression]
-
- The identifier is a single capital letter specifying the action
- to be taken. The modifier is either "Y" (meaning 'yes') or "N"
- (meaning 'no'), referring to the results of a preceding phrase
- match. If a phrase was matched, a command modified with "Y" will
- execute, and one modified with "N" will not. If a phrase was not
- matched, a command modified with "N" will execute and one modi-
- fied by "Y" will not. Unmodified commands will always execute.
- A modified command encountered before a phrase match is performed
- will not execute. Note that the "phrase match" condition may be
- set or reset under VTL by a comparison command or a wait-until-
- key-struck command, as well as by a phrase matching command.
- A command is delimited from the expression following it by a
- colon (":"), which must occur as the second or third character of
- the line. A colon occurring elsewhere in the line is ignored;
- one preceded by an unrecognized command and/or modifier is also
- ignored. An invalid or non-existant command is interpreted as a
- TYPE command, and the line is printed unmodified on the screen.
- The TYPE command is therefore the default command, which will be
- executed if no other command is encountered.
- The expression is a line of text, the contents of which may
- depend on the command preceding it. Excepting the ACCEPT,
- CALCULATE, and GET (disk file read) commands, references to a
- register embedded within the expression are replaced by the
- current contents of the register. The other commands use a
- register reference to specify the destination of data input by
- the user (ACCEPT), calculated (CALCULATE) or read (GET). A
- register reference consists of a two adjacent characters, the
- first of which specifies the register type:
-
- "%" -- integer;
- "#" -- real;
- "$" -- string.
- "@" -- extended string.
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 9
-
-
-
-
-
-
-
-
- The second character is a capital letter from "A" to "Z",
- specifying which of the twenty-six registers of a given type is
- meant. For example, if string register "C" contains the string
- "help", and the line:
-
- T:Give me some $C!!!
-
- is executed, the expression:
-
- Give me some help!!!
-
- is printed on the screen.
- The contents of the extended string registers are set
- automatically by VTL.EXE, and may not be modified by ACCEPT, GET
- or CALCULATE commands. Not all of these registers are used by
- the current release of VTL.EXE. Those used, and their contents,
- are listed in Appendix B. A reference to an extended string
- register, with the exceptions above, is otherwise treated
- similarly to a reference to a standard string register.
- An additional register, the 'comparison register', which may
- not be addressed directly by a reference, is used to hold an
- expression to be used for phrase matching. The comparison
- register contents are changed by ACCEPT, WAIT, and INSERT
- commands as described below. The current contents of the
- comparison register, and their length in characters, may be
- obtained via extended register references.
- An expression may be further broken down into a subcommand
- folllowed by arguments. The subcommand is a single capital
- letter, possible values of which depend on the command. The
- subcommand and its arguments are separated by comments. The
- advanced (i.e. machine-dependent) commands having to do with
- video screen control, sound, and graphics use this form of
- expression.
- The individual commands' syntax is described below, using
- the following conventions:
-
- [modifier] is the optional modifier Y or N
- [register] is a register reference as described above
- [expression] is a line of text as described above
- [operator] is a special expression used for calculations,
- as described below
- [sub-cmd.] is a subcommand (a single letter used to modify
- the effect of a command, followed by a comma).
- [arg.] is an argument of a command (i.e. a subsection of an
- expression). Arguments are separated by commas.
- {} brackets enclose a quantity which may be omitted
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 10
-
-
-
-
-
-
-
-
-
- TYPE command
-
- Form: T[modifier]:[expression]
-
- or
-
- [expression]
-
- This is the default command; a line of text without a
- command prefix (i.e. a colon in the first three characters) is
- displayed on the screen, unless the line begins with "*" (i.e. is
- a label) or "!" (i.e. is a comment). If a colon is found in the
- first three characters, and a command is not recognized, the line
- is typed unmodified; otherwise, the command prefix is stripped
- from the line to be displayed.
- If the expression ends with the character "&" (ampersand),
- the usual carriage return/line feed at the end of the line of
- text is suppressed. This permits conversational queries.
-
- Examples: TY:That is correct! ("That is correct!" is displayed
- if a phrase match preceded this statement.)
- This is a line of text. (This line is displayed.)
- !Another teaching program... (a comment--ignored)
- *12345 (a label--noted, as described below, but not
- displayed)
- Enter a number...& (The line, minus the "&", is
- displayed, and the cursor remains on the same
- line. A succeeding ACCEPT command may then be
- used to request input.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 11
-
-
-
-
-
-
-
-
-
- ACCEPT command
-
- Form: A[modifier]:
-
- or
-
- A[modifier]:[register]
-
- This command is used to get a line of text input from the
- user. The text must be terminated by an 'enter' (<cr>). If a
- register is specified, the current contents of the register are
- replaced by the data input. If a string (i.e. non-numeric
- characters) is entered when a number is requested, the register
- contents are set to 0.
- If the most recent TYPE command expression ended with a "&",
- the ACCEPT command does not prompt input. If not, the ACCEPT
- command prompts for input with the character "<". The data
- input are, in any case, put in the comparison register for
- subsequent phrase matching. The data remain in the comparison
- register until the next ACCEPT, INSERT or timed WAIT command is
- executed.
- ACCEPT and INSERT commands cause the uppercase equivalent of
- whatever was entered or inserted to be placed in extended string
- register U (@U), the unmodified contents of the insertion
- register in extended string register J (@J) and the length in
- characters of whatever was put in the insertion register in
- extended string register I (@I).
-
- Examples: AY: (If a phrase match occurred, data input is
- accepted.)
- A:%B (Data input is accepted, and numeric integer
- result is inserted in integer register B.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 12
-
-
-
-
-
-
-
-
-
- MATCH command
-
- Form: M[modifier]:[phrase],[phrase],[phrase]...
-
- The current contents of the comparison register are scanned
- for any occurrence of each of the phrases (separated by commas)
- included in the command, until either a match is found or all
- phrases are exhausted. If a match is found, all subsequent com-
- mands with the modifier "Y" will execute, and those with modifier
- "N" will not. If no match is found, the reverse is true. These
- conditions will hold until the next MATCH command is executed.
- Phrases are matched EXACTLY; upper case characters are
- treated as different from lower case.
- If the expression is preceded by a quotation mark ("), the
- entire expression, including any commas, is used for the phrase
- match.
-
- Examples: MY:yes,Yes (If the preceding MATCH command yielded
- a phrase match, this command matches for the
- phrases "yes" and "Yes".)
- M:a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
- (If the comparison register contains any lower
- case character, a phrase match occurs.)
- M:"a,b,c,d (The entire phrase 'a,b,c,d' is used for
- the phrase match.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 13
-
-
-
-
-
-
-
-
-
- JUMP command
-
- Form: J[modifier]:[expression]
-
- This command controls the flow of statement execution. The
- statement lines in a VTL program are executed one by one, in the
- order in which they are found in the program file. A JUMP
- command uses the expression as a label, and tries to find a
- matching label elsewhere in the program (excluding the "*" prefix
- used to designate a label to the TYPE command). If such a label
- is not found, an error message is printed and the program and
- interpreter terminate. If the label is found, the next line of
- text and subsequent lines are executed.
- As lines of program are executed, labels may be encountered
- as TYPE commands. These labels are noted by the interpreter, and
- their location is stored. A label may be any combination of
- characters (i.e. any valid expression). Up to 100 labels may be
- used in a single program. Labels passed during a jump are also
- noted. Although labels may be of any reasonable length (up to
- 254 characters), it is best to keep them short.
- If a JUMP command is executed, and the specified label has
- already been noted, control is passed as described above. If the
- label has not been noted, the remainder of the program is
- searched for it.
-
- Examples: JY:frame1 (If a phrase match has occurred, execution
- resumes at the line following the line "*frame1")
-
- C:$F=frame (inserts the string "frame" in string reg-
- ister F)
- J:$F1 (Jumps to the line following the label "frame1".
- The value "frame" is inserted in place of the
- register reference "$F".)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 14
-
-
-
-
-
-
-
-
-
- USE subroutine command
-
- Form: U[modifier]:[expression]
-
- This command executes a jump to a subroutine. The
- expression is interpreted as a label. The current line location
- is saved, and a jump to the specified label is performed. A
- RETURN command exits the subroutine and resumes execution of the
- program at the line following the USE command.
-
- Example: UN:mistake (If the last MATCH was unsuccessful, the
- subroutine beginning at the line starting with the
- label "*mistake" is executed.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 15
-
-
-
-
-
-
-
-
-
- RETURN from subroutine
-
- Form: R[modifier]:
-
- If no subroutine is being executed, this command is ignored.
- Otherwise, a jump is executed to the command following
- the most recently executed USE command.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 16
-
-
-
-
-
-
-
-
-
- END command
-
- Form: E[modifier]:
-
- This command ends execution of the current program. The
- interpreter then asks the user for the name of the next program.
- If the current program was being executed as a subroutine, the
- originating program resumes.
-
- Example: EY: (If a phrase match has occurred, execution ends.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 17
-
-
-
-
-
-
-
-
-
- CALCULATE command
-
- Form: C[modifier]:[register]=[expr.]{[operator][expr.]}
-
- This command is used to perform simple calculations, plac-
- ing the results in a register. Calculations may be numeric or
- string, depending on the type of the register specified as the
- results' destination. If no operator is specified, the value of
- the expression is inserted in the register.
- The operators permitted for numeric calculations are:
-
- + -- addition
- - -- subtraction
- * -- multiplication
- / -- division
-
- The two expressions separated by the operator are evaluated as
- real numbers. Exponential notation is permitted. Non-numeric
- expressions will be interpreted as 0. Division by 0 is
- permitted, but will cause an error message; the maximum positive
- real or integer value will be inserted in the destination
- register.
- String calculations may extract either the leftmost N
- characters of the first expression (operator "<<") or the
- rightmost N characters (operator ">>"), where N is the numeric
- value of the second expression.
-
- Examples: CN:$A=help me! (If the preceding MATCH was unsuccess-
- ful, the expression "help me!" is inserted in
- string register A.)
- C:#A=%C+1 (The current value of integer register
- C is inserted as the first expression; the second
- expression is "1". The value of integer register
- C is incremented by 1 and inserted in real regis-
- ter A.
- C:$B=abcdefg<<3 (The string "abc" is inserted in
- string register B.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 18
-
-
-
-
-
-
-
-
-
- HARDCOPY command
-
- Form: H[modifier]:[expression]
-
- The expression is printed on the currently selected system
- lineprinter. If the lineprinter is off-line, or no lineprinter
- is present on the system, the computer will "hang".
-
- Example: HY:The result is #C. (The current value of real regis-
- ter C will be inserted in the expression, and
- the expression will be printed if a phrase match
- has occurred.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 19
-
-
-
-
-
-
-
-
-
- OPEN a disk file command
-
- Form: O[modifier]:{[mode],}[expression]
-
- The expression must be a valid DOS filename. If no mode is
- specified, the file is initially opened for INPUT. If the file
- is not found, a new file is opened for OUTPUT. The file remains
- open until a file close command is executed. The access mode of
- the file may be changed, however, by read and write commands.
- The mode is a single letter, corresponding to the three
- possible modes of access to a sequential file:
-
- I -- input
- O -- output
- A -- append
-
- If the specified mode is input, the file is opened to be read
- only. If the file is not found, a new file with the same name
- will be opened for output. If the mode is output, a new file is
- opened; if the file already existed, its current contents are
- lost. If the mode is append, the file must already exist or an
- error will occur. If the file exists, all subsequent output will
- be appended to its current contents.
-
- Example: O:file.dat (The disk file "file.dat" is opened.)
- O:O,file.dat ("file.dat" is opened for output.)
- O:A,file.dat ("file.dat" is opened for append.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 20
-
-
-
-
-
-
-
-
-
- eXIT (close) a disk file command
-
- Form: X[modifier]:
-
- A disk file previously opened is closed. If no file is
- open, an error message is printed, and the program and
- interpreter exit.
-
- Example: XY: (If a phrase match has occurred, the currently
- open disk file is closed.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 21
-
-
-
-
-
-
-
-
-
- GET (read) from a disk file command
-
- Form: G[modifier]:[register]
-
- A line of input is read from the currently open disk file.
- If no file is open, an error message is printed and the program
- and interpreter terminate. If the file is currently open for
- OUTPUT or APPEND, the file is closed and reopened for INPUT. If
- the end of file is encountered on an attempt to read, an error
- message is printed and the program and interpreter terminate.
- If the destination register is numeric (real or integer),
- the line read is interpreted accordingly. If the register is a
- string register, the line replaces the register's current
- contents.
-
- Examples: GY:$A (If a phrase match has occurred, a line is read
- from the currently open file, and inserted in
- string register A.)
- G:%Y (A line is read from the currently open file
- converted to an integer, and the result inserted
- in integer register Y.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 22
-
-
-
-
-
-
-
-
-
- PUT (write) to disk file command
-
- Form: P[modifier]:[expression]
-
- The expression is written to the currently open disk file.
- If the file is opened for INPUT, the file is closed and reopened
- for APPEND. The expression is then written to the end of the
- file. If no file is open, an error message is printed and the
- program and interpreter terminate.
- If an ampersand (&) is appended as the last character of the
- expression, the expression will be written to the file without a
- terminal carriage return and line feed. Otherwise, the
- a carriage return-line feed pair of characters will be added to
- the end of the expression written to disk.
-
- Example: PN:Test failed. (If the preceding MATCH was unsuccess-
- ful, the phrase "Test failed." is written to the
- currently open disk file.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 23
-
-
-
-
-
-
-
-
-
- LINK (chain) to next program command
-
- Form: L[modifier]:[expression]
-
- The expression is a valid VTL program name (see below). The
- named program is executed. The contents of registers are left
- unchanged. Data may be passed to the new program via the
- registers. If the named program is not found, the interpreter
- displays an error message and exits. If the expression is
- omitted, the interpreter exits.
- The program name must ALWAYS be a full DOS filename with
- extension. No default file extension is assumed.
- A program being executed as a subroutine via a DO command
- may chain to another program; control will not be passed back to
- the original ('calling') program until an END command is
- encountered, or until the current line number exceeds the maximum
- line number specified in the DO command.
-
- Examples: L:prog2.vtl (The program prog2.vtl is executed.)
- LN: (If the preceding MATCH was unsuccessful, the
- interpreter exits to DOS.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 24
-
-
-
-
-
-
-
-
-
- INSERT data into comparison register command
-
- Form: I[modifier]:[expression]
-
- The expression is inserted into the comparison register, and
- used for all subsequent MATCH commands until the comparison
- register is reloaded by another INSERT or an ACCEPT or timed WAIT
- command.
-
- Example: I:$Q (The current contents of string register Q are
- inserted in the comparison register).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 25
-
-
-
-
-
-
-
-
-
- FRAME load command
-
- Form: F[modifier]:[expression]{,[arg.1]{,...[arg.4]}}
-
- This command clears the display and then reads and displays
- up to 23 lines of text from a file, optionally beginning at a
- specified line of the file. The expression must be a valid DOS
- file name. Up to four arguments are optional. The first
- argument is interpreted as the number of the first line in the
- file to be displayed. The second argument is the number of lines
- to be displayed (range 1-23). If the first line to be read is
- out of range (i.e. EOF is encountered), an error message is
- printed and the program and interpreter exit. If EOF is
- encountered while loading a frame, the file is closed and
- execution proceeds. A FRAME load command with only the file name
- specified will load either the first 23 lines of the file or the
- entire file, if fewer than 23 lines are present. If only the
- first line is specified, that line and the next 22 lines (or
- fewer, if EOF is encountered) are displayed.
- The third argument specifies a starting line number on the
- display. This will be the line on which the first line read from
- the file is printed. The fourth argument specifies a starting
- column number on the display. All lines read from the file will
- be displayed beginning at this column number. Use of these two
- arguments permits changing the contents of a 'window' of the text
- display, without altering other contents outside the window.
-
- Examples: F:frame1.txt,11,5 (The display is loaded with lines
- 11-15 of the file "frame1.txt".)
- FN:frames.f1,20 (If the preceding MATCH was
- unsuccessful, line 20 and up to 22 succeeding
- lines of file "frames.f1" are displayed.)
- F:frame1.doc (Up to 23 lines from file "frame1.doc"
- are displayed, beginning at the first line.)
- F:frame1.txt,1,10,5,15 (The first 10 lines from file
- "frame1.txt" are displayed, beginning at line 5
- of the display, and offset 14 columns.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 26
-
-
-
-
-
-
-
-
-
-
- YES-IF command
-
- Form: Y[modifier]:[sub-cmd.],[expr.]{[operator][expr.]
-
- This command either compares two expressions or compares a
- single expression with zero. If the comparison is true, the
- phrase-match condition flag is set to 'yes'. If not, the flag is
- set to 'no'. The sub-command is a single character which
- determines the mode of the comparison:
-
- % -- integer mode (expressions interpreted as integers)
- # -- real mode (expressions interpreted as real numbers)
- $ -- string mode (expressions interpreted as strings)
-
- A single expression is compared with zero (a null string in
- string mode). If the expression=0 (or a null string), the flag
- is set to 'no'; if not, the flag is set to 'yes'.
- In the two-expression form, the two expressions are
- separated by an operator:
-
- > -- greater than
- = -- equals
- < -- less than
-
- The two expressions are evaluated according to the mode, and
- compared according to the operator. If the condition thus
- expressed is true, the phrase match flag is set to 'yes'. If
- not, the flag is set to 'no'.
- This permits both structured decision-making within VTL
- programs, and exact string matching (obviating some of the
- difficulties in using the inexact matching of the M: command).
- In using this command, keep in mind that positive numbers
- placed in the extended string registers are preceded by a blank
- (' ').
-
- Examples: Y:%,%A>1 (the flag is set to 'yes' if the contents of
- integer register A are >1)
- YN:$,$A=hello (if the flag is already set to 'no', the
- contents of string register A are compared with
- the string "hello"; if the contents = "hello"
- then the flag is set to 'yes', otherwise to 'no')
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 27
-
-
-
-
-
-
-
-
-
-
- DO command
-
- Form: D[modifier]:[filename]{,[first line]{,[last line]}}
-
- This command executes the named file, in effect, as a
- subroutine. Execution of the calling program is suspended; the
- context (i.e. all labels and pointers) of the calling program is
- saved. The registers' contents are left unchanged, however. The
- named file is executed beginning at the specified first line (or
- at line 1 if none is specified). Execution of the named file
- proceeds until an END command is encountered, end of file is
- reached, or the number of the line to be executed exceeds the
- number of the last line, if this is specified.
- The named file cannot itself invoke another file via a DO
- command (attempting to execute a DO command causes the
- interpreter to halt, with an error message). Apart from this
- restriction, all other commands in the named file will execute
- normally.
- When the named file terminates execution, the calling
- program resumes at the next command.
- As with the Frame command, the file name specified must
- include the file extension (i.e. there is no default extension).
-
- Examples: DY:frame44.vtl,1,23 (file "frame44.vtl" is executed,
- beginning at line 1, and ending at line 23, if
- this line is reached prior to an L: or E: command
- is executed)
- C:%A=23\D:lesson.f%A (file "lesson.f23" is executed,
- beginning at line 1)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 28
-
-
-
-
-
-
-
-
-
- WAIT command
-
- Form: W:{[expression]}
-
- This command, if used without an expression, halts execution
- until a key is struck. The key value struck is discarded.
- If an expression is specified, the expression is evaluated
- as a number of seconds to wait for a key to be struck. If no key
- is pressed during this time period, the comparison register is
- erased (i.e. loaded with a null string), and the phrase match
- flag is set to 'no'. If a key (including a function key) is
- struck, the character(s) invoked by the keystroke replace the
- current contents of the comparison register, and the phrase match
- flag is set to `yes`.
- This command may be used to time replies (i.e. for a quiz).
- Note that if a function key is struck, the entire expression (not
- just the first letter) associated with that key is inserted in
- the comparison register.
-
- Examples: W: (execution halts until a key is struck)
- W:10 (a keystroke is awaited for 10 seconds)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 29
-
-
-
-
-
-
-
-
-
-
- ZERO command
-
- Form: Z[modifier]:{sub-cmd.}
-
- This command erases the contents of all standard registers,
- or all of a particular class of register. Numeric register
- contents are set to zero, and string register contents are set to
- a null string (i.e. one of zero length). If no subcommand is
- present, all registers are zeroed. A subcommand specifies the
- class of registers to be zeroed, and may consist of the single
- character:
-
- % -- integer registers
- # -- real registers
- $ -- string registers
-
- The specified class of registers is cleared.
-
- Examples: Z: (all registers are cleared.)
- Z:$ (all string registers are cleared.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 30
-
-
-
-
-
-
-
-
-
- Advanced Commands (specific for the IBM (R) PC)
-
- These commands control function key access, video screen
- modes, graphics, sound, and switching between monochrome and
- color display adapters--functions which are dependent on the
- specific characteristics of the IBM (R) Personal Computer.
- Many of these commands have subcommands with multiple
- arguments. Depending on the subcommand, arguments in the same
- position in an argument list (a series of arguments separated by
- commas) may have different meanings. In some cases, therefore,
- different subcommand forms of the same command will be discussed
- on separate pages to avoid confusion.
-
- Display Modes
-
- The color graphics adapter may be used in one of 4 display
- modes. The selected mode determines the number of characters per
- line when text is displayed, and whether or not graphics (lines,
- shapes, etc.) in black and white or color may be displayed. It
- is noteworthy that text may be displayed in any of these modes,
- including all graphics modes, but that its appearance will be
- influenced by which mode is selected. The monochrome display
- adapter is always in 80-column text display mode, and permits
- only limited graphics using special characters (as described in
- the IBM BASIC Manual, pp. G-1 to G-5), which are also available
- in the color adapter's text modes.
- The color adapter's modes are:
-
- 0 -- text (40 or 80 columns--two text modes)
- 1 -- medium resolution (320 x 200) graphics
- (with 40 column text display)
- 2 -- high resolution (640 x 200) graphics
- (with 80 column text display)
-
- Either of the text modes, and medium resolution graphics, may be
- in either monochrome (black and white) or color.
- In VTL, the VIDEO WIDTH, VIDEO COLOR, and VIDEO SELECT
- commands are used to select display modes for the color adapter.
- The VIDEO COLOR command is also used to specify color
- combinations for text or graphics display, and is also used to
- vary character display modes (reverse, blinking, bright,
- underlined) for text for both adapters. At the cost of some
- complexity, the VIDEO commands give the courseware author
- complete command of either display adapter. The SCREEN commands
- are used to create graphics using the color adapter's graphics
- modes, which must first, however, be properly selected, or an
- error results.
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 31
-
-
-
-
-
-
-
-
-
-
- VIDEO control command
-
- Form: V[modifier]:[sub-cmd.]{,[arg1,...,arg5]}
-
- This command provides control of character attributes,
- and cursor location, and also permits clearing the screen. The
- function desired is selected by the sub-command:
-
- Z -- clear screen
- C -- character attributes or selection of color
- L -- cursor location
- S -- selection of screen mode
- W -- selection of character display row width (in columns)
-
- Simple Forms
-
- The 'Z' subcommand requires no arguments, and causes the
- screen to clear.
- The 'W' subcommand requires only one argument, which is
- either '40' or '80', depending on the desired display width.
- The V:W command automatically changes the color video mode to
- character (i.e. non-graphics). This form of the VIDEO command
- should not be used with the monochrome adapter. If the argument
- is not specified, 40 columns is assumed.
-
- Examples: V:Z (clears the current screen)
- V:W,80 (clears the current screen and sets display
- mode to character, 80 columns)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 32
-
-
-
-
-
-
-
-
-
-
- VIDEO COLOR command
-
- Form: V[modifier]:C,arg1,arg2{,arg3}
-
- This command sets the display mode for all subsequently
- printed characters in character mode using the monochrome display
- adapter, and also sets character and background colors for either
- character mode or medium resolution graphics mode using the color
- adapter.
- The 'C' subcommand takes up to 3 arguments, which are in the
- same order and which may assume the same values as the arguments
- for the IBM advanced BASIC 'COLOR' command. The effects of
- different values of these parameters are discussed fully in the
- IBM BASIC manual, pp. 4-49 to 4-52. However, for the convenience
- of the user, an abridged discussion is included here.
- The three arguments, which should always be specified,
- represent 'foreground' (arg1), 'background' (arg2) and `border`
- (arg3). 'Border' has meaning only if the color adapter is being
- used. In text mode, arg1 may range from 0-31 (default 0), arg2
- may range from 0-7, and arg3 may range from 0-15.
- If the monochrome adapter is in use, arg3 is ignored. If
- arg1=0 then the foreground intensity (that of all characters
- displayed) is black. If arg1=1 then the foreground intensity is
- low-intensity white, and all characters are displayed underlined.
- If arg1 is in the range 2-7, the foreground intensity is low-
- intensity white. If 8 is added to any of these values (except
- 0), the foreground intensity becomes high intensity white; if 16
- is added, the characters blink. If arg2 (background) is 0, then
- the background intensity (surrounding displayed characters) is
- black. If arg2 is 1-7, the background intensity is low-intensity
- white.
- If the color adapter is in use, arg1 is the foreground color
- (one of the 16 possible colors in high or low intensity), and
- arg2 is the background color (one of the 8 possible low-intensity
- colors). Arg3 is one of the 16 possible colors in high or low
- intensity, which is assigned to the border of the screen, outside
- the area used for character display. Adding 16 to the desired
- color value for arg1 causes the characters to blink.
- If the color adapter is in medium resolution graphics mode,
- then arg1 becomes the background color (one of the 16 possible),
- and arg2 may be a number from 0-255. If the number is even,
- color palette '0' (green, red, brown) is used for the SCREEN
- graphics commands (see below). If the number is odd, color
- palette '1' (cyan, magenta, white) is used. Arg3 is ignored, and
- may be omitted.
-
- Examples: V:C,0,7,0 (this sets reverse video mode, with black
- characters on a white background)
- V:C,12,3,1 (this sets foreground=light red,
- background=cyan, border=blue in color mode)
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 33
-
-
-
-
-
-
-
-
-
- Tables of colors and useful combinations of arg1,arg2,arg3
- are found below:
-
-
- Color table: Low Intensity High Intensity
-
- 0 -- Black 8 -- dark grey
- 1 -- Blue 9 -- light blue
- 2 -- Green 10 -- light green
- 3 -- Cyan 11 -- light cyan
- 4 -- Red 12 -- light red
- 5 -- Magenta 13 -- light magenta
- 6 -- Brown 14 -- yellow
- 7 -- White 15 -- bright white
-
- Some Useful Monochrome Display Combinations
-
- 7,0,0 (standard) white characters on
- black background
- 0,7,0 black characters on white
- background
- 1,0,0 underlined white characters on
- black background
- 9,0,0 bright underlined white characters
- on black background
- 15,0,0 bright white characters on black
- background
- 16,7,0 blinking black characters on white
- background
- 17,0,0 blinking underlined white charac-
- ters on black background
-
- Note: the use of blinking characters is extremely distracting,
- and should be avoided except for EXTREME emphasis!
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 34
-
-
-
-
-
-
-
-
-
-
- VIDEO LOCATE (cursor) command
-
- Form: V[modifier]:L,arg1,arg2,arg3{,arg4,arg5}
-
- This command is used in text mode to move the cursor to a
- specified position on the screen, turn the cursor on or off, and
- specify the cursor height and position.
- The 'L' subcommand takes up to 5 arguments, which are in the
- same order and which may assume the same values as the arguments
- for the IBM advanced BASIC 'LOCATE' command. The user is
- referred to the IBM BASIC manual pages 4-51 and 4-155,
- respectively, for further explanations. Non-specified (omitted
- or blank) arguments are interpreted as '0', and may have
- unintended results.
- Arg1 is the character display row (1-25). Arg2 is the
- display column (1-40 in width 40, 1-80 in width 80). Arg3 may be
- either 0 (cursor off) or 1 (cursor on).
- Arg4 and arg5 specify the beginning and ending dot row on
- the current line used to display the cursor. Fourteen dot rows
- (0-13) are present on a given line displayed by the monochrome
- adapter; 8 dot rows (0-7) are displayed on a line by the color
- adapter. If arg4 and arg5 are omitted, the current cursor
- (default 12,13 for monochrome and 6,7 for color) is preserved.
-
- Examples: V:L,23,1,0 (positions cursor to beginning of line 23
- and turns it off)
- V:L,10,10,1,1,13 (positions cursor to line 10,
- column 10, displays it, and sets it to full
- character height)
-
- Note: all text displayed after the cursor is relocated is
- printed beginning at the current cursor location, even if the
- cursor itself is not displayed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 35
-
-
-
-
-
-
-
-
-
-
- VIDEO SELECT screen mode command
-
- Form: V[modifier]:S,arg1,arg2,arg3,arg4
-
- This command is used to select the display mode for the
- color graphics display adapter.
- Arg1 is the display mode--0 for text, 1 for medium
- resolution graphics, or 2 for high resolution graphics.
- Arg2 may be either 0 for color disabled (i.e. monochrome
- display) or 1 for color enabled.
- Arg3 and arg4 are meaningful only in text mode. In order to
- accomodate graphics, the color display adapter has memory
- capacity far in excess of that needed for even 25 row by 80
- column text display. There is sufficient memory to hold four
- full pages of 25 x 80 display (numbered pages 0-3), or 8 full
- pages of 25 x 40 display (pages 0-7). The text display width,
- set by the VIDEO WIDTH command described above, determines how
- many possible pages of text may be specified. Arg3 is the
- 'active page'--that to which all subsequent text is printed, to
- be displayed either currently or later. Arg4 is the 'visual
- page'--i.e. the page currently being displayed. Use of these
- arguments permits concurrent loading of one page during display
- of another, as for animation. When changing pages, the current
- cursor location is made current for the new active page. It is
- therefore wise to specify cursor location with a VIDEO LOCATE
- command immediately after switching active pages, and to make
- note of the current cursor location on the old page, if intending
- to return to that location again. Under normal circumstances,
- page switching is an unnecessary complication, however, though
- experienced courseware designers may use it to stunning effect.
-
- Examples: V:S,0,0,1,1 (text mode selected, color disabled,
- active and visual pages both page 1)
- V:S,0,1,3,7 (text mode, color enabled, page 3
- active, page 7 displayed--valid if width=40
- columns ONLY!)
- V:S,1,1,0,0 (medium resolution graphics mode, color
- enabled)
- V:S,2,0,0,0 (high resolution graphics mode)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 36
-
-
-
-
-
-
-
-
-
- SCREEN graphics command
-
- Forms: S[modifier]:[sub-cmd.],[arg1,...arg8]
- S[modifier]:[sub-cmd.],[expression]
-
- This command is used to create graphic displays, mainly
- using the color/graphics adapter, though one subcommand may be
- used to produce a line of characters using either display system.
- An attempt to use a graphics subcommand applicable only to the
- color adapter while the monochrome adapter is in use will cause
- an error.
- The subcommands supported by the SCREEN command are:
-
- D -- draw lines, using turtle graphics
- C -- draw a circle
- S -- set a point to a given color
- R -- reset a point to background color
- P -- paint a region of the display a given color
- L -- display a line of characters
-
- Subcommand 'L' is the only one valid using the monochrome display
- adapter.
- In order to properly use the other subcommands, one must
- understand the coordinates used to specify locations on the
- screen in graphics modes. In medium-resolution graphics, the
- screen is divided into 200 rows of 320 columns of picture
- elements ('pels'), each of which may be colored one of four
- possible colors. In high-resolution graphics, the screen holds
- 200 rows of 640 columns of pels, each of which may be either
- black or white. The coordinates begin at 0,0 which is located at
- the upper left hand corner of the screen. The maximum
- coordinates (319,199 in medium, and 639,199 in high resolution)
- are of the point at the bottom right of the screen. When a
- graphics mode is selected, the screen is cleared, and the
- currently selected pel is that in the center of the screen
- (160,100 in medium, and 320,100 in high resolution). All turtle
- graphics commands then may reference points relative to this
- starting point.
- The term 'turtle graphics' refers to drawing lines on a
- graphics screen by moving an imaginary cursor (the 'turtle'),
- which leaves a trail of colored pels behind it. Movements may be
- specified either in terms of absolute coordinates (i.e. move
- turtle to a specified point on the screen) or in relative
- coordinates (move turtle n points vertical or horizontal from its
- current position). Although it is possible to draw any shape at
- all by moving the turtle, doing so requires considerable practice
- and forethought, as well as full knowledge of the command
- language used to move the turtle around the screen. Also,
- creating circles or painting in large areas of the screen would
- be very awkward using turtle graphics, and therefore, IBM BASIC
- provides special functions for these purposes.
- The shape of any figure drawn with the SCREEN graphics
- commands is influenced by the 'aspect ratio' of the graphics
- screen. The display area is rectangular, not square, and so each
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 37
-
-
-
-
-
-
-
-
- pel is also a rectangle. Thus, a rectangle n pels wide and n
- pels long is not a square as one might expect, but a rectangle
- with its long axis in the y direction. Pels are more narrow in
- the x direction than in the y direction. The ratio of pel height
- to width is 1.2:1 in medium resolution graphics and 2.4:1 in high
- resolution graphics. Thus, a rectangle would have to be 24 pels
- wide and 20 pels high to appear as a square in medium resolution,
- and 48 pels wide and 20 pels high to appear as a square in high
- resolution.
- As might be expected, there is considerable correspondence
- between the SCREEN graphics commands and IBM BASIC graphics
- commands, as is explained below.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 38
-
-
-
-
-
-
-
-
-
- SCREEN DRAW command
-
- Form: S[modifier]:D,[expression]
-
- This command is used to draw lines on the color graphics
- screen, using turtle graphics; an attempt to use this command
- while in text mode will cause an error.
- The expression consists of a series of turtle graphics
- subcommands which may be separated by spaces, if desired, for
- readability. Each subcommand is a capital letter, which may be
- prefixed by another capital letter (to modify its effect), and
- which is followed by either one number or two numbers separated
- by a comma. These subcommands are fully explained in the IBM
- BASIC manual, pages 4-79 to 4-83. All of the subcommands
- supported by the IBM BASIC 'DRAW' statement are valid, except for
- the 'X' subcommand and the '={variable name' construction, both
- of which will cause errors if used. Improper turtle graphics
- subcommands may also cause an error, as well as unintended
- results!
- For the convenience of the user, the subcommands are
- summarized below. Small letter 'n' is used to represent an
- integer number; small letters 'x' and 'y' are used to represent
- coordinate values (either absolute or relative).
-
- Un -- move turtle up n pels (decreasing y coordinate)
- Dn -- move turtle down n pels (increasing y coordinate)
- Ln -- move turtle left n pels (decreasing x coordinate)
- Rn -- move turtle right n pels (increasing x coordinate)
- En -- move diagonally up and right n pels
- Fn -- move diagonally down and right n pels
- Gn -- move diagonally down and left n pels
- Hn -- move diagonally up and left n pels
-
- These subcommands move the turtle relative to its current
- position.
-
- Mx,y -- move the turtle to the point with coordinates x,y
- M+x,y -- move the turtle x pels horizontal, y pels vertical
- relative to current position
- M-x,y -- move turtle -x pels horizontal (i.e. left) and y
- pels vertical relative to current position
-
- This subcommand is used to move the turtle either to a
- particular point (absolute coordinates x,y) or in an x,y
- displacement relative to the current position.
- Any of these subcommands may be prefixed with 'B', in which
- case the turtle moves but does not draw a line; or with 'N', in
- which case the turtle moves, then returns to its previous
- position.
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 39
-
-
-
-
-
-
-
-
- The additional subcommands below may be used to modify the
- effect of the movement commands.
-
- An -- rotate all subsequent displacements n increments of 90
- degrees (n in the range 0-3)
- Cn -- draw all subsequent lines in color n (n in the range
- 0-3). The default color is 3. The actual color
- selected depends on which palette is in use--which may
- be set using the VIDEO COLOR command.
- Sn -- all subsequent relative displacements are multiplied
- by n/4 (as a scale factor) before they are executed
-
- In VTL, very long turtle graphics commands may be composed
- by assigning a string of subcommands to a string register, and
- then referencing the register multiple times within the
- [expression] of a SCREEN DRAW command. The compiled form of the
- VTL interpreter permits strings of length up to 65,535 characters
- (!); however, the interpreter will surely run out of memory
- before it runs out of string length, especially on a computer
- with only 64K of main memory. The interpreted form of the
- interpreter permits a maximum string length of only 255
- characters. In any case, command constructions using multiple
- string register references should be used with caution!
-
- Examples: S:D,BM25,25 U30R40D30L40 (draws a square with its
- lower left corner at 25,25)
- C:$A=U30R40D30L40\S:D,$ABR25$A (draws two squares sep-
- arated by 25 pels)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 40
-
-
-
-
-
-
-
-
-
- SCREEN CIRCLE command
-
- Forms: S[modifier]:C,arg1,arg2,arg3
- S[modifier]:C,arg1,arg2,arg3,arg4
- S[modifier]:C,arg1,arg2,arg3,arg4,arg5,arg6,arg7
-
- This command is used to draw a circle, or part of one, in
- graphics mode using the color adapter. An attempt to use this
- command in text mode will cause an error.
- Arg1,arg2 are the coordinates of the center of the circle.
- Arg3 is the radius of the circle. These arguments must always be
- specified.
- Arg4 is the color of the circle (default 3, range 0-3).
- Arg5 and arg6 are starting and ending angles in radians. If
- either is negative, the ends of the segment of circle specified
- will be connected by lines to the center point. These angles are
- specified using standard mathematical notation (i.e. moving
- counterclockwise with increasing angle).
- Arg7 is the aspect ratio for the circle, which may be varied
- to draw an ellipse with its long axis in either the x or y
- direction.
- The effect of different values of these parameters is
- further explained in the IBM BASIC manual, pages 4-41 to 4-43.
-
- Examples: S:C,100,100,40 (draws a circle, radius 40, center at
- 100,100)
- S:C,100,100,40,1 (draws similar circle, in color 1)
- S:C,100,100,40,1,3.14,6.28 (draws lower half of same
- circle)
- S:C,100,100,40,1,3.14,6.28,2 (draws lower half of
- ellipse with aspect ratio 2)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 41
-
-
-
-
-
-
-
-
-
- SCREEN SET command
- SCREEN RESET command
-
- Forms: S[modifier]:S,arg1,arg2{,arg3}
- S[modifier]:R,arg1,arg2{,arg3}
-
- These commands are used to change the color of an individual
- point on the graphics screen. Arg1,arg2 is the coordinate of the
- point. Arg3 need not be specified, and defaults to 3 for the SET
- command and 0 for the RESET command. If arg3 is specified, it is
- the color the point is to be set to (range 0-3 in medium, and 0-1
- in high resolution), and the two commands are equivalent.
-
- Examples: S:S,100,100 (pel with coordinates 100,100 intensified
- with color 3)
- S:R,100,100 (same pel intensified with color 0)
- S:R,100,100,2 (same pel intensified with color 2)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 42
-
-
-
-
-
-
-
-
-
- SCREEN PAINT command
-
- Form: S[modifier]:P,arg1,arg2,arg3,arg4
-
- This command is used to fill in an area of the screen with a
- given color. The area is defined by picking a point within it,
- with coordinates arg1,arg2. Arg3 is the color to be painted.
- Arg4 is the color of all points forming the boundary of the area
- to be filled in. All of these arguments must be specified.
-
- Example: S:D,BM25,25U20R24D20L24\S:P,7,27,3,3 (draws a square in
- color 3, and fills it in with color 3)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 43
-
-
-
-
-
-
-
-
-
- SCREEN LINE command
-
- Form: S[modifier]:L,arg1,arg2,arg3
-
- This command may be used in either text or graphics mode to
- place a line of characters on the screen, horizontally,
- vertically or diagonally.
- Arg1 is the ASCII code for the character to be used,
- specified as a decimal integer. Arg2 is the number of characters
- to be displayed (i.e. the number of times the character is to be
- repeated). Arg3 is the direction of the line, relative to the
- current cursor position, as displayed below:
-
- 6 7 8
- 5 C 1
- 4 3 2
-
- where C is the current cursor position. As shown, if arg3=1, the
- line is drawn to the right; if arg3=4, the line is drawn
- diagonally down and left.
- ASCII codes for all characters are found in Appendix G of
- the IBM BASIC manual.
-
- Example: S:L,65,10,6 (displays a row of 10 'A's diagonally up
- and left)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 44
-
-
-
-
-
-
-
-
-
- KEY control command
-
- Forms: K[modifier]:[expression],[expression]
- K[modifier]:[subcommand]
-
- This command permits the user to assign a string expression
- of up to 16 characters to any of the ten function keys (F1-F10),
- turn the function key display on line 25 of the screen on or off,
- and list the assigned values, if any, of the function keys.
- The first form of this command is used to assign a value to
- a function key. The first expression is evaluated as a number
- between 1 and 10, specifying the key; the second expression
- (which is automatically truncated to 16 characters if too long)
- is assigned to the specified key. If the second expression ends
- in an ampersand (`&`), a carriage return will be appended to the
- expression if its length is 15 characters or less.
- The second form of the command performs other functions
- according to the subcommand:
-
- ON -- turns on the function key display
- OFF -- turns off the function key display
- LIST -- lists all function key values on the screen
-
- The effects of these subcommands are those of the IBM BASIC 'KEY
- ON', 'KEY OFF', and 'KEY LIST' commands (see Manual, pp. 4-131 to
- 4-133). Initially, VTL assigns no values to the
- function keys.
-
- Note WELL: If the soft key display is ON, and a VIDEO LOCATE
- command is used to attempt to move the cursor to line 25, an
- error will result.
-
- Examples: K:1,Valley Forge (the string expression "Valley Forge"
- is assigned to function key F1)
- K:LIST (all function key values are displayed)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 45
-
-
-
-
-
-
-
-
-
- BEEP (sound) command
-
- Forms: B[modifier]:[sub-cmd.],arg1{,arg2}
- B[modifier]:[sub-cmd.],[expression]
-
- This command is used to activate the built-in speaker of the
- PC, to create single tones, or to play a melody. Three
- subcommands specify the action desired:
-
- B -- beep (at standard frequency)
- S -- sound a specified frequency for a specified interval
- P -- play a melody using the IBM BASIC tone definition
- language
-
- For subcommand 'B', arg1 specifies the number of times a
- 'beep' should be repeated. The repeated beep sounds as a
- continuous tone; thus arg1 specifies the length of the beep.
- For subcommand 'S', arg1 represents the frequency in Hz, and
- ranges between 37 and 32767. Arg2 represents the duration of the
- sound in system clock 'ticks' (18.2 ticks in one second).
- For subcommand 'P', the second form of the BEEP command is
- used. The expression is a string of commands in the IBM BASIC
- tone definition language, used by the PLAY statement (manual, pp.
- 4-209 to 4-212). For the user's convenience, the commands, which
- may be separated by spaces for readability, are summarized below.
- All commands listed in the manual except 'X' are permitted.
-
- A to G -- plays the indicated note in the current octave,
- sustaining the note for the current length. A '+' or
- '#' as a suffix (i.e. 'G#' or 'G+') indicates a sharp
- (if valid); a '-' as a suffix (i.e. 'G-') indicates a
- flat
- Nn -- n ranges between 0 (rest) and 84 (C'''), and specifies
- a note (an alternate method besides A-G and
- accidentals)
- On -- n ranges between 0 and 6. Selects the current octave.
- Octave 3 starts with middle C; octave 4 is the default.
- Ln -- n ranges between 1 and 64. Selects the current note
- length (1/nth note). As an alternate method, if using
- A-G and accidental notation, a note may be followed by
- n to specify the length of only that note (i.e. B-16 is
- a B-flat held as a 16th note)
- Pn -- n ranges between 1 and 64. Specifies a rest of value
- 1/nth.
- Tn -- n ranges between 32 and 255. Sets the tempo as n
- quarter notes in a minute. The default is 120.
- MF -- Music Foreground. The VTL program does not continue
- until the specified melody has been completed. This is
- the default state.
- MB -- Music Background. The VTL program continues while
- the melody is playing. Use this with caution, as the
- music may be distracting, and melodies of >256 notes to
- be played in background may cause an error.
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 46
-
-
-
-
-
-
-
-
-
- MN -- Music Normal. Each note plays for 7/8 of the
- specified length. This is the default state.
- ML -- Music Legato. Each note plays for the full length.
- MS -- Music Staccato. Each note plays for 3/4 of the
- specified length.
-
-
- Examples: BY:B,10 (10 concatenated beeps)
- B:S,55,36 (2 seconds of 55 Hz)
- B:P,CDEFGAB O5 C (plays a scale in quarter notes)
-
- Note: complex melodies may be formed by assigning phrases to
- string registers, then using register references to insert them
- into a 'B:P' command. This feature should be used cautiously
- since very long expressions may cause an error by exhausting
- memory, exceeding maximum string length, or, if music is played
- in the background, exceeding maximum background note storage
- space.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 47
-
-
-
-
-
-
-
-
-
- QUICKMOVE command
-
- Form: Q[modifier]:[sub-cmd.],[filename]{,arg1}
-
- This command is used to load an entire screen of text or
- graphics. In text mode, not only the characters are loaded into
- the screen, but all character attributes (i.e. colors or modes)
- are loaded too. For the color adapter, arg1 specifies the page
- of text memory (0-3 for 80 column, 0-7 for 40 column) to be
- loaded. In graphics mode, the entire screen is loaded for either
- high or medium resolution, and arg1 is omitted. The argument is
- ignored if the monochrome adapter is in use.
- Similarly, this command may be used to 'dump' the contents
- of the specified text page, or the graphics screen, to a disk
- file. The subcommands are:
-
- L -- load screen from specified file
- D -- dump screen from specified file
-
- The action taken depends on the CURRENT display mode, set either
- by default or by a VIDEO SELECT command. For subcommand 'L', the
- specified file is checked for appropriate length (2000 bytes for
- a 40-column text screen, 4000 bytes for an 80-column text screen,
- and 16000 bytes for a graphics screen). If the file length does
- not match the current display mode, an error occurs. For
- subcommand 'D', the current display mode and text screen width
- determines the size of the file created, and which data are
- transferred.
- For either subcommand, the specified file name must be a
- valid DOS filename, with extension.
-
- Examples: V:S,1,1,0,0\V:C,1,0\Q:L,video.dmp (medium-resolution
- graphics mode is selected; palette 0 is selected,
- with color 1 as background; and a graphics screen
- previously saved in file 'video.dmp' is loaded)
- V:W,40\V:S,0,0,0,1\Q:L,char.dmp,1 (40-column text mode
- is selected with page 1 visualized; page 1 is
- loaded with the previously saved contents of file
- 'char.dmp')
- Q:D,char.dmp,3 (assuming text mode, the current
- contents of page 3--2000 bytes if in 40 column
- width, 4000 bytes if in 80 column width--is dumped
- into file 'char.dmp')
- Q:D,video.dmp (assuming graphics mode, the contents
- of the screen are dumped into file 'video.dmp'.
- If the monochrome display is in use, the contents
- of the current display are saved.)
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 48
-
-
-
-
-
-
-
-
-
- NEWDISPLAY command
-
- Form: N[modifier]:[sub-cmd.]
-
- This command is valid if and only if both monochrome and
- color/graphics adapters are present. Otherwise, use of this
- command will result in an error. The subcommands are:
-
- C -- switch to color adapter
- M -- switch to monochrome adapter
-
- If the specified adapter is already in use, the command is
- ignored. When a switch is made to the color adapter, 40-column
- text mode is selected as default. Default mode for the
- monochrome adapter is 80-column text.
-
- Examples: N:C (switch to color adapter)
- N:M (switch to monochrome adapter)
-
- Note: Extended register V (referenced by @V) contains a single
- capital letter specifying which adapter(s) VTL found present.
- This may be 'M' (monochrome adapter only), 'C' (color adapter
- only), or 'B' (both present). The command, 'Y:@V=B' may be used
- to test for the presence of both adapters.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 49
-
-
-
-
-
-
-
-
-
- III. Use of the Interpreter and Virtual Teaching Language
-
- The interpreter is invoked with the command "VTL<cr>". As
- described above, VTL first searches for the file, "autoexec.vtl"
- as a default program to execute. If this file is not found, the
- interpreter asks:
-
- program name:
-
- The user then specifies the name of the program to be run. The
- file extension ".vtl" need not be entered, and is assumed. Files
- with another extension may be executed as programs.
-
- The PILOT teaching language was developed in the late 1960's
- by Dr. John Starkweather, as a specialized computer language for
- development of 'courseware'--programs used for computer-aided
- instruction (CAI). The original language was quite simple, with
- only a few basic commands (TYPE, ACCEPT, MATCH, JUMP, END). As
- computers became less expensive and more widespread, the original
- language was extended to incorporate more commands, and was
- further modified to fit the capabilities of different computer.
- The result was chaos (as it was with many other computer
- languages), and a standard (PILOT '73) was established--a
- standard which this interpreter ignores (!). As usual, when a
- standard is ignored, there are good reasons for adding to the
- PILOT chaos. The 1973 standard includes a number of multi-
- character commands (e.g. AS: for ACCEPT SINGLE) which add
- confusion to the syntax, and therefore make the language less
- usable by the novices it was supposedly designed for. The
- present version uses only single-letter commands, most of which
- require only one expression following the colon (:), and some of
- which require no modification at all. Twenty-six (A: to Z:)
- commands comprise the entire command set of the language. The
- arrangement and form of arguments (expressions following the
- colon) in the more complex commands has been made consistent.
- Also, arguments for the graphics and sound commands have been
- kept consistent with those used by corresponding IBM BASIC
- statements:
-
- VTL IBM BASIC
-
- V:L LOCATE
- V:C COLOR
- V:S SCREEN
- V:W WIDTH
- S:D DRAW (excluding "X")
- S:C CIRCLE
- S:S PSET
- S:R PRESET
- S:P PAINT
- B:S SOUND
- B:P PLAY (excluding "X")
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 50
-
-
-
-
-
-
-
-
-
- The following paragraphs explore the ways this new PILOT
- dialect may be used to create courseware, as well as
- presentations, adaptive tests, and other uses for the fun and
- profit of the programmer.
-
- Creating a Program
-
- VTL programs are PC-DOS text files. A file is a collection
- of data on disk. A text file is a collection of text--letters,
- numbers, etc. arranged in sentences, stored on disk. Text files
- are created using a computer program designed to enter, edit and
- store text, using the keyboard and video display to enter and
- edit, and the disk drive to store. The simple line editor
- EDLIN.COM which is supplied with PC-DOS is more than adequate for
- entering VTL programs. Instructions for EDLIN are found in
- Chapter 4 of the DOS manual.
- Users who have more sophisticated editors, such as the IBM
- Personal Editor (R), or word-processing programs such as Wordstar
- (R), may wish to use these programs to create VTL files. Word-
- processing programs must be used with caution, however, since
- they may insert peculiar characters into the text to effect
- formatting of printed output. Wordstar, for example, must be
- used in its 'non-document' mode to create programs.
-
- Presenting Text with VTL
-
- The simplest possible VTL program would be an existing text
- file, such as a chapter from a book. One would only have to
- rename the file containing the text, giving the file the new
- extension ".plt" (e.g. chapter1.txt would become chapter1.plt).
- Such a file would be treated by the interpreter as a long series
- of TYPE commands. All of the text would be displayed on the
- screen, but would scroll past the reader too quickly to be read.
- One could modify the file by inserting a line consisting of:
-
- \Press any key to continue...\W:
-
- every 22 lines. As an alternative, one could write and execute
- the following program:
-
- Z:%\!this clears all the integer registers
- C:%A=1\!set the initial line number to 1
- *loop\F:chapter1.txt,%A\C:%A=%A+23
- \Press any key to continue...\W:\J:loop
-
- This program would display every 23 lines as a frame, then add 23
- to the starting line number, and display the next 23 lines. This
- program incorporates an 'endless loop' in line 3, which would
- continue to display frames until the FRAME command would run out
- of lines in the file, at which time a "frame eof" error would
- result. As an alternative, one could count the number of frames
- in the chapter, and modify the program thus:
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 51
-
-
-
-
-
-
-
-
- Z:%\C:%A=1\C:%F=1\!use %F for frame count
- *loop\F:chapter1.txt,%A\\Press any key to continue...
- W:\Y:%,%F=9\JY:end\!test if at 9th frame--last frame
- C:%A=%A+23\C:%F=%F+1\J:loop
- *end\E:
-
- The FRAME command is extremely powerful, and is best used to
- separate the text of a lesson or a presentation from the
- statements controlling the flow of a program. The FRAME command
- can also be used to set up part of a screen as an illustration
- (using graphics characters built into the IBM PC character set),
- and then present text on another part of the screen. For
- example, the lines:
-
- F:illus23.grp,1,12
- F:text23.txt,1,12,12,1
-
- would read 12 lines from file 'illus23.grp' to the top 12 lines
- of the display, and read 12 lines from the file 'text23.txt' to
- the next 12 lines of the display. This is 'vertical windowing',
- which is the easiest form of using sections of the display screen
- as 'windows' for different sorts of information. Using column
- offsets (the 5th argument of the FRAME command), it is possible
- to do horizontal windowing as well, but this is much trickier.
-
- Presenting Graphics
-
- There are several ways to present graphics using VTL. The
- first--creating a figure using graphics characters in a text
- file--was alluded to in the preceding section. Turtle graphics
- may be used to create pictures if you have a color/graphics
- adapter and display which is IBM BASIC compatible. Using turtle
- graphics is slightly more complicated, however.
- First, the display must be set to graphics mode--medium or
- high resolution. The color palette must then be selected.
- Finally, the image is created using a series of graphics
- commands. For example, this sequence:
-
- V:S,1,1,0,0\!this selects graphics mode, medium resolution
- V:C,7,0,0\!this selects white as foreground color,
- !palette 0, and a black border to the screen
- S:D,BM50,100U30R40D30L40\!this creates a white box with
- !its lower left corner at coordinates 50,100 on the screen
-
- A third technique for presenting graphics is to use a
- graphics editing program to create, and save an image. The
- picture is saved as a disk file, which, if it is in the proper
- form, may be loaded using a QUICKMOVE LOAD command. Of course,
- the display mode and color must be set before the QUICKMOVE
- command can be executed. The author recommends PCCRAYON (R) as a
- cheap, effective graphics editor, whose DRAW (.drw) files can be
- loaded by VTL. For example:
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 52
-
-
-
-
-
-
-
-
-
- V:S,1,1\V:C,7,0,0\Q:L,illus23.drw
-
- would load the contents of file illus23.drw into the color
- display in medium resolution graphics mode. Note that a high-
- resolution graphics file would also be loaded (erroneously!) by
- this command sequence--it is up to the programmer to see that
- graphics modes are correct (but this is simple).
- Any graphics editor program which saves the contents of
- color adapter video memory in BLOAD form can be used to create
- screens for VTL. The disk file holding a screen must be 16512
- bytes in length to be loaded by VTL. (This statistic may be
- checked using the DOS 'DIR' command.)
-
- Testing--Adaptive and Otherwise
-
- After presenting material, one may wish to test the
- comprehension of the information by the user of your program.
- The easiest way to do so is to ask a question on the screen, have
- the user type in a reply, and test the reply for correctness.
- For example:
-
- How many bytes must a graphics screen file hold to be
- valid for loading by a QUICKMOVE command? &\A:\!get reply
- M:16512\TY:Correct!!!
- TN:Nope--16512 bytes is the correct answer.
-
- This example uses a MATCH command to test the user's response,
- which is automatically entered into the 'comparison register'--a
- temporary storage area which holds the most recently typed
- response from an ACCEPT or WAIT command. One need not have the
- user type a response directly; for multiple choice questions, the
- function keys can be assigned values, and then pressed by the
- user to respond, as below:
-
- K:1,true\K:2,false
- *1\V:Z\\\\\\ True or false--Nuclear War can be hazardous
- to your health.
-
- F1 -- true
- F2 -- false
- \W:\M:true\TY:You said a mouthful, buddy!!
- M:false\TY:You must not have read the question!!!\JN:1
-
- Note that the WAIT command will return ALL characters transmitted
- by pressing a key (including a function key). The program above
- tests also for pressing an invalid key, and repeats the question
- if one is pressed.
- Using these and other facilities of VTL, one may develop
- many varieties of test question. Individual questions can then
- be compiled into examinations. User responses can be recorded,
- either in print (via a HARDCOPY command) or on disk (via
- sequential file operations). For example:
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 53
-
-
-
-
-
-
-
-
-
- Your response: &\A:$A\O:A,response.txt\P:$A\X:
-
- This records the response of the user in a file (already created)
- named 'response.txt'. The user input in this example is appended
- to the existing contents of the file by using the Append file
- mode for the OPEN command. (The Output file mode would be used
- initially to create the file and erase a previous file with the
- same name, if any existed.)
- A commonly used application of computer-aided instruction is
- 'adaptive testing'. For this technique, an examination with
- multiple questions is compiled. The order in which the questions
- are presented to the user is determined in part by the user's
- responses. Thus, the examination 'adapts' to the user's
- apparent level of knowledge. In VTL, this can be done by using
- conditional JUMP or DO commands, where the condition is tested
- for as described above.
- If responses are to be timed, the timed WAIT command can be
- used for user responses:
-
- F1 -- true
- F2 -- false\\W:10\JN:noresponse\M:true\!etc. etc....
-
- The timed wait can also be used to time presentation of material.
- The number of seconds should be set so that the slowest reader
- anticipated can finish the material (unless you wish to be
- tricky). A faster reader can omit the pause by pressing the
- space bar, or any other key.
-
- Program Flow and Segmentation
-
- Discussing adaptive testing brings us to consider how a
- teaching program should be designed in its entirety. Since VTL
- reads program lines one at a time from disk, the best way to
- write a teaching program in this dialect is to separate the
- course material from the actual program as much as possible.
- This keeps the main program concise, and keeps the pause involved
- in JUMPing to a statement earlier in the program as brief as
- possible. Different parts of the main program can be kept in
- short program files which chain to each other via the LINK
- command. Subprograms invoked by DO commands can be used to
- create graphics, play music, present text, or execute an
- examination question. In any case, the designer of a program
- MUST have a firm plan of the material to be presented, the
- methods to be used to present it, and the strategy to be used to
- test the student's comprehension.
-
- Use of RAMDISK
-
- Electronic disk, or 'RAMDISK' refers to the use of extended
- computer main memory ('RAM') to emulate a disk drive. This
- technique is very popular with users of the IBM PC, which can
- address up to 640K bytes (roughly 655,000 characters) of data in
- main memory, but whose programs typically require only about 128K
- bytes (roughly 131,000 characters) for operation. Memory in
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 54
-
-
-
-
-
-
-
-
- excess of 128K bytes can be used as temporary 'disk' storage by
- running a program which convinces DOS that a third diskette drive
- is present, whose capacity equals the amount of excess memory.
- Needless to say, random-access main memory will transfer
- data to the computer much faster than diskette. If the computer
- is running VTL, and the program the interpreter is executing
- resides in 'RAMDISK', the program will execute somewhat faster
- than from diskette. FRAME and QUICKMOVE commands will also load
- the screen faster. However, if only a small amount of excess
- memory is available for RAMDISK, it is best to store only the
- main program and subroutines in electronic disk. The interpreter
- itself need not reside there. A DOS batch file can be used to
- set up the electronic disk, copy the requisite files to it, and
- begin execution (if the initial program segment is named
- 'AUTOEXEC.VTL') as in this example, which assumes that the
- program diskette is in drive A and the RAMDISK is drive C:
-
- DOS Command Effect
-
- RAMDISK/160 sets up 160K byte electronic disk
- COPY *.PLT C: copies all program segments
- COPY *.TXT C: copies all frame files
- C: sets default drive to C
- A:VTL starts interpreter
-
- If the program only is to be copied to disk C (i.e. all frame
- files remain on disk A), the program must specify the disk drive
- to be searched for frame files, for example:
-
- F:a:frame1.txt instead of F:frame1.txt
-
- As an alternative, drive assignments can be entered by the user:
-
- Program drive (A:, B:, C:): &\A:$P
- Text drive (A:, B:, C:): &\A:$T
- ...
- L:$Pprog44.plt
- ...
- F:$Tframe44.txt
-
- or these assignments can be read from a disk file.
- Since electronic disk can be so useful for VTL, not to
- mention most other applications, the author enthusiastically
- recommends this technique to all IBM PC users. A typical
- electronic disk program retails for $50-100, a small price to pay
- for the performance improvement, if you already have more than
- 128K bytes of main memory. If you don't, 64K byte RAM chip sets
- currently retail for under $50 each....
-
- Envoi
-
- The author hopes that the information in this section will
- help the reader become an effective and enthusiastic user of the
- VTL interpreter and language. The additional demonstration
- programs included with the interpreter provide some other
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 55
-
-
-
-
-
-
-
-
- examples of the uses of VTL--the extent of which may be limited
- only by your imagination!
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 56
-
-
-
-
-
-
-
-
-
- Appendix A: Error Messages
-
- VTL is designed to detect and report most of the possible
- errors in command syntax, file access, and IBM BASIC command
- access (i.e. for graphics) which a courseware designer or
- programmer may accidentally include in his programs. Of course,
- despite careful design by the author, not every possible error
- can be provided for. If an error occurs which is not trapped or
- internally detected, it is reported by the message:
-
- IBM BASIC error N at PILOT line M
-
- where N is the BASIC error code and M is the VTL
- program line number at which the error occurred. If such an
- error occurs, the courseware author should check the error code
- against the list in Appendix A of the IBM BASIC manual. Some
- errors, such as 'Out of Memory', may be self-explanatory. An
- error code of 5 (invalid function call) usually signifies an
- error in tone-definition language or turtle graphics command
- construction. In any case, errors of this sort, if not
- correctable by simple courseware modifications should be reported
- to your software dealer or directly to the publisher.
- VTL error codes are displayed using the form:
-
- ** [error explanation] at line N of program [file]**
-
- where N is the line of the VTL program in which the error
- occurred. If the error occurred while another file is being
- executed by a DO command, an additional message is printed
- stating the name and line of the program file from which the DO
- command was executed. The following error messages are listed
- by error explanation.
-
- bad chain file -- the filename specified for a LINK command is
- invalid, or the file does not exist
- bad draw syntax -- an error in construction of a turtle graphics
- expression has been made
- bad exec. file -- the filename specified for a DO command is
- invalid, or the file does not exist
- bad frame file -- the filename specified for a FRAME command is
- invalid, or the file does not exist
- bad graphics syntax -- illegal arguments have been provided for a
- SCREEN command other than DRAW
- bad play syntax -- an error in construction of a tone-definition
- language expression has been made
- bad quickmove file -- the filename specified for a QUICKMOVE
- command is invalid, or a load file does not exist
- duplicate label = [label] -- a second occurrence of the same
- label in the current program has been detected
- end of file -- a GET command encounters end of file (EOF) on an
- attempted read.
- exec. file eof -- the end of a file named in a DO command was
- reached before the specified first line was found
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 57
-
-
-
-
-
-
-
-
- file already open -- a file has already been opened for access
- prior to the current OPEN command.
- file not open -- a file close, GET or PUT is attempted prior to
- opening a file.
- frame eof -- the specified first line to be displayed of a frame
- file is out of range.
- illegal beep command -- invalid construction of a BEEP command
- has been detected
- illegal beep subcommand -- a non-existant or invalid subcommand
- has been specified for a BEEP command
- illegal calculation -- either no "=" or an invalid register
- reference encountered in a CALCULATE command.
- illegal comp. type -- the subcommand for a YES-IF command was
- incorrect (i.e. not %, # or $)
- illegal do command -- invalid construction of a DO command has
- been detected
- illegal filename -- a filename given to an OPEN command is
- invalid.
- illegal key directive -- the directive for a KEY command of the
- form K[modifier]:[directive] is invalid (i.e. not ON, OFF or
- LIST).
- illegal key # -- the function key number specified for a KEY
- command of the form K[modifier]:[key # expr.],[expr.] is
- outside the range of 1-10.
- illegal quickmove command -- invalid construction of a QUICKMOVE
- command has been detected
- illegal quickmove subcommand -- a non-existant or invalid
- subcommand has been specified for a QUICKMOVE command
- illegal read register -- an invalid register reference was
- supplied as the destination for a GET command.
- illegal register destination -- an invalid register reference was
- supplied as the input destination for an ACCEPT command
- illegal screen command -- invalid construction of a SCREEN
- command has been detected
- illegal screen subcommand -- an illegal or non-existant
- subcommand has been specified for a SCREEN command
- illegal video command -- invalid construction of a VIDEO command
- has been detected
- illegal video subcmd. -- the subcommand for a VIDEO command is
- invalid (i.e. not L, C, or Z).
- illegal zero command -- an illegal register type has been
- specified for a ZERO command
- invalid newdisplay command -- either both display adapters are
- not present, or an invalid subcommand has been specified for
- a NEWDISPLAY command
- label not found -- a JUMP command cannot find the specified
- label.
- nested Do -- a file being executed by a DO command itself
- contains a Do command.
- printer error -- a printer hardware error (not ready or paper
- out) occurs with a HARDCOPY command
- quickmove mode mismatch -- the length of a specified load file
- does not match that expected for the current display mode
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 58
-
-
-
-
-
-
-
-
- recursive register reference -- this error may occur when a
- string register reference occurs within a line of input from
- a file or the keyboard, which is assigned to the same string
- register referenced in the line of input. The next
- reference to that register will cause infinite expansion of
- the reference, with either an 'out of memory' or `illegal
- string length' error
- specified line out of range -- the first line of a file specified
- to a DO command does not exist in the file
- subr. stack overflow -- more than 30 subroutines were nested,
- causing this error message on the 31st subroutine call.
- too many labels -- the current program contains more than
- 100 labels; the 101st has just been encountered.
- unspecified error -- an error has been trapped for which VTL
- has no handling routine. This message precedes the 'IBM
- BASIC error' message.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 59
-
-
-
-
-
-
-
-
-
-
- Appendix B: Extended String Registers
-
-
- As noted in Section II, there are 26 extended string
- registers maintained by VTL, the contents of which may not be
- changed directly by the user, but may be inserted into
- expressions when referenced. A reference to an extended string
- register consists of the character '@' followed by a capital
- letter from A-Z. The contents of the specified register will be
- inserted in the expression containing the reference, replacing
- the reference (as for the other types of register). Not all 26
- of the extended string registers are used in the current release;
- therefore, references to unused registers will be replaced with a
- null string.
- The registers used by the current release, and their
- contents are:
-
- @A -- date VTL execution was begun (set on ini-
- tialization)
- @B -- time VTL execution was begun (set on
- initialization)
- @C -- current command line (set when line read)
- @D -- date of current program execution (set when program
- file first opened)
- @I -- length of contents of comparison register (set
- whenever contents changed)
- @J -- contents of comparison register (set whenever contents
- changed)
- @K -- returned value of numeric register from ACCEPT
- @L -- current program line number (set when line read)
- @P -- name of current program (set when program file first
- opened or when new file chained)
- @S -- number of seconds elapsed before key struck on
- execution of most recent WAIT command (set if key
- struck)
- @T -- current time (set whenever a command is executed)
- @U -- uppercase equivalent of text ACCEPTed or INSERTed
- @V -- display adapters present: M, C or B
- @X -- filename of file most recently executed by a DO
- command (set when file opened for execution)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 60
-
-
-
-
-
-
-
-
-
- Appendix C: Intermixing Text and Graphics
-
-
- Although the techniques for doing so are not well explained
- in the IBM BASIC manual, it is possible to place text on the
- screen while using the color/graphics adapter in either medium or
- high resolution graphics mode, even though a cursor is not
- displayed while in graphics mode. This is done by specifying a
- cursor location (via the VIDEO LOCATE command), and then using a
- TYPE command to print text at the specified location.
- Relating the position of text to graphics coordinates is not
- difficult. Characters are displayed in an 8 x 8 pel matrix;
- thus, 200 rows of pels permit 25 lines; 320 columns of pels (in
- medium resolution) permit 40 columns; and 640 columns of pels (in
- high resolution) permit 80 columns. The upper left hand corner of
- a character matrix will begin at the coordinate (8*(R-1),8*(C-1))
- where R is the row number and C is the column number of the
- character. Characters printed will be displayed in the current
- foreground color.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 61
-
-
-
-
-
-
-
-
-
- INDEX
-
- A
-
- ACCEPT command 8,9,10,11,24,52,53
- conversational form 11
- Arguments (for commands) 9
- Automatic program execution 6,54
- AUTOEXEC.VTL 6,54
-
- B
-
- BASIC compiler dialect 3
- BASIC run time errors 57
- BEEP command 45
-
- C
-
- CALCULATE command 8,9,13,17,27,39,50,51
- Chaining VTL programs 6,23
- Closing a disk file 20
- Color, setting 33
- Command syntax 10-48
- ACCEPT 11
- BEEP 45
- CALCULATE 17
- DO 27
- END 16
- FRAME 25
- GET 21
- HARDCOPY 18
- INSERT 24
- JUMP 13
- KEY 44
- LINK 23
- MATCH 12
- NEWDISPLAY 48
- OPEN 19
- PUT 22
- QUICKMOVE 47
- RETURN 15
- SCREEN 36-43
- TYPE 10
- USE 14
- VIDEO 31-35
- WAIT 28
- XIT 20
- YES-IF 26
- ZERO 29
- Comments 8
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 62
-
-
-
-
-
-
-
-
-
- D
-
- Disk copying 4
- DO command 23,27,53
-
- E
-
- END command 16,23,51
- Error messages 56-58
-
- F
-
- File copying 4,5
- File operations 20-23
- open 20
- close 21
- read 22
- write 23
- FRAME command 25,50,51,54
-
- G
-
- GET command 8,9,21
-
- H
-
- HARDCOPY command 3,18
-
- I
-
- INSERT command 9,24
- Installation 4-5
- Interpreter
- features 6-7
- installation 4-5
-
- J
-
- JUMP command 13,50,52,53
-
- K
-
- KEY command 44
-
- L
-
- Labels 8,10,13,14
- LINK command 23,53,54
-
- M
-
- Manual, printing 4
- MATCH command 12,52
- Modifier 8,9
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 63
-
-
-
-
-
-
-
-
-
-
- N
-
- NEWDISPLAY command
-
- O
-
- OPEN (a disk file) command 19,53
- modes 19,21
- Operators 9,17,26
-
- P
-
- Phrase match 8,12,16
-
- Q
-
- QUICKMOVE command 47,52,54
-
- R
-
- Ramdisk (electronic disk) 53,54
- Registers 6,8-9
- comparison 9,12
- extended string 9,59
- integer 6,8,11,17,21,26,27
- naming 8-9
- real 6,8,17,18
- string 6,8,9,13,17,21,24,26,39
- RETURN command 14,15
-
- S
-
- SCREEN command 30,36-43,51
- CIRCLE subcommand 36,40,49
- DRAW subcommand 36,38-39,49,51
- LINE subcommand 36,43,49
- PAINT subcommand 36,42,49
- RESET subcommand 36,41,49
- SET subcommand 36,41,49
- Subcommands 9,30
-
- T
-
- Turtle graphics 36
- TYPE command 10,51,52
-
-
- U
-
- USE (subroutine) command 14
-
- V
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 64
-
-
-
-
-
-
-
-
- VIDEO command 30,31-35,49,51,52,60
- COLOR subcommand 30,31,32-33,49,51,52
- LOCATE subcommand 31,34,49,60
- SELECT subcommand 30,31,35,49,51,52
- WIDTH subcommand 30,31,35,49
- ZERO subcommand 31,49,52
- Video display modes 30,32,35
- selection 35
- VTL interpreter
- running 49
- language design 49
- VTL programs
- creation 8,50
- chaining 23
- naming 50
-
- W
-
- WAIT command 9,24,28,50,51,52,53
-
- X
-
- XIT (close disk file) command 20
-
- Y
-
- YES-IF command 26,51
-
- Z
-
- ZERO command 29,50,51
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COPYRIGHT STUART A. JONES 1982, 1983, 1984 Page 65
-
-
-
-
-
- To print the manual, use the 'docu.bat' batch file.
- The self-running demonstration programs may be run by specifying
- program 'srun' to the interpreter.
- Requests for information, support, and (of course) registrations should
- be addressed to:
-
- Stuart A. Jones
- C/O Nuclear Software
- 1045 Treeline Drive
- Allentown, Pa. 18103