home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
-
-
-
-
- CBT
-
- USERS MANUAL
-
- VERSION 3.01
- March 20, 1986
-
-
-
-
- TABLE OF CONTENTS
-
-
- What is CBT ................................................. 1
- Uses for CBT ................................................ 1
- List of verbs ............................................... 2
- Variables ................................................... 3
- Modifiers ................................................... 3
- Multi-line statements ....................................... 3
- Reserved words .............................................. 3
- Notation used in this manual ................................ 4
- Usage of CBT ................................................ 5
- Syntax of verbs
- AT ........................................................ 6
- BEEP ...................................................... 6
- BOX ....................................................... 6
- CAPS ...................................................... 7
- CENTER .................................................... 7
- CHAIN ..................................................... 7
- CLS ....................................................... 7
- CURSOR .................................................... 8
- DEBUG ..................................................... 8
- DISPLAY ................................................... 8
- DO ........................................................ 9
- DUMP ...................................................... 9
- ERASE ..................................................... 9
- GOSUB ..................................................... 10
- GOTO ...................................................... 10
- HALT ...................................................... 10
- IF ........................................................ 10
- INKEY ..................................................... 11
- INPUT ..................................................... 11
- JOIN ...................................................... 12
- NUM ....................................................... 12
- PAINT ..................................................... 12
- PRINT ..................................................... 12
- REPORT .................................................... 12
- RESTORE ................................................... 13
- RETURN .................................................... 13
- SAVE ...................................................... 14
- SCREEN .................................................... 14
- SET ....................................................... 14
- STORE ..................................................... 15
- TYPE ...................................................... 15
- VERIFY .................................................... 16
- WAIT ...................................................... 16
- Syntax reference chart ...................................... 17
- 1
- What is CBT
-
-
- CBT is a language designed for the easy creation of Computer Based
- Training. CBT is intended for use by the non-programmer.
-
-
-
- Uses for CBT
-
- Programming Demonstrations - You can use CBT to demonstrate the
- operation of a program without needing to produce a single line of
- programming code.
-
- Computer Based Training - With CBT it is not necessary for a
- programmer to produce a computer based training program.
- 2
- VERB LIST
-
- Verb Action
-
- AT Position cursor on screen
- BEEP Sound the alarm
- BOX Draw a box on the screen
- CAPS Turn Caps Lock on/off
- CENTER Center text
- CHAIN Transfer control to another program
- CLS Clear screen, or an area on the screen
- CURSOR Turn cursor on, off, or make it large
- DEBUG Show each statement as it is being executed
- DISPLAY Display text on the screen
- DO Perform another file
- DUMP Print memory variables on the printer
- ERASE Erase memory variables
- GOTO Go to a label in this CBT lesson
- HALT Stop execution now
- IF Test memory variable to a value
- INKEY Accept one character without display
- INPUT Input text
- JOIN Concatenate memory variables
- NUM Turn NUM Lock on,off
- PAINT Paint an area on the screen with a certain attr.
- PRINT Send data to the printer
- REPORT Send a file to the printer
- RESTORE Read in memory variables saved with save
- RETURN Return to a calling program
- SAVE Save all memory variables to a file on disk
- SCREEN Read .SCR file and display at cursor
- SET Set operating parameters of CBT
- STORE Store data to a memory variable
- TYPE Display data on screen with varying speeds
- VERIFY Input a string of data, comparing to text
- WAIT Wait a specified # of seconds
- 3
- VARIABLES
-
- Variables in CBT are defined as memory boxes. In CBT you are allowed
- 256 such memory boxes. Each memory box may be 80 characters at the most.
- All variables must begin with the character @, and are numbered from 1 to
- 256. Variable need not be used in numerical order.
-
-
- MODIFIERS
-
- In various places during the description of each verb you will see
- what is called a modifier. A modifier modifies the way text is show on the
- screen. In CBT you are allowed 5 modifiers.
-
- Modifier How modified
-
- HIGH Display text at full intensity
- BLINK Display text blinking
- REV Display text in reverse video
- BLREV Display text both blinking reverse video
- ULINE Display text underlined
-
-
- MULTI-LINE STATEMENTS
-
- In CBT it is permissible to have multiple statements per line. This
- is accomplished by separating each statement with the | character. Please
- note however that a DO statement will be the last statement executed on any
- one line.
-
-
- RESERVED WORDS
-
- In CBT there are two reserved words. They are FKEY and LENGTH. After
- each INPUT and INKEY you can determine what key was pressed to terminate
- the input and the length of what was typed in. LENGTH will contain the
- length of the data that was type in. FKEY will contain the key that was
- used to terminate the input. FKEY and its values are listed below
-
- VALUE KEY PRESSED VALUE KEY PRESSED
- 1 F1 13 ENTER
- 2 F2 14 HOME
- 3 F3 15 UPARROW
- 4 F4 16 PGUP
- 5 F5 17 LFARROW
- 6 F6 18 RTARROW
- 7 F7 19 END
- 8 F8 20 DNARROW
- 9 F9 21 PGDN
- 10 F10 27 ESCAPE
-
- 4
- NOTATION USED IN THIS MANUAL
-
- The notation used in this manual is as follows:
-
- <> Anything enclosed in these symbols is optional
- [ ] Anything separated by these symbols means that you have
- to select one of the options
-
- 5
- USAGE OF CBT
-
- A CBT lesson is nothing more than an ASCII file on disk. If no
- extension is given, an extension of .CBT is assumed. There is a special
- file that is REQUIRED for EACH lesson. That file has the same name as the
- lesson, but an extension of .LAB. This file contains a reference for each
- label in your lesson. It is created with the program INDEX. Below is a
- sample running of CBT from the writers standpoint.
-
- Create source file
- Index source file INDEX SOURCE
- Run source file CBT SOURCE
-
-
- While writing your CBT lessons it is a good idea to re-index any
- lesson that you make a change to. It is really only necessary to re-index
- if you add any labels or lines to a lesson.
- 6
- SYNTAX OF VERBS
-
- Verb : AT
-
- Description: Position cursor at line, column
- Line must be between 1 and 25
- Column must be between 1 and 80
-
- Syntax : AT Line,column
-
- Examples : AT 1,1 Position cursor at line 1 column 1
- AT 15,30 Position cursor at line 15 column 30
-
-
-
-
- Verb : BEEP
-
- Description: Sound an alarm
-
- Syntax : BEEP
-
- Examples : BEEP Sounds the alarm
-
-
-
-
- Verb : BOX
-
- Description: Draw a box with the border going from line, col to line1, col2
- with border.
-
- LINE1 is the upper line of the box
- COL1 is the upper left column of the box
- LINE2 is the lower line of the box
- COL2 is the lower right column of the box
- BORDER is the border desired
- 0 = no border
- 1 = single line border
- 2 = double line border
-
- Syntax : BOX LINE1,COL1,LINE2,COL2,BORDER
-
- Examples : BOX 1,1,25,80,0 Draw a box around the entire screen with no
- border. Same as CLS
-
- BOX 1,1,5,10,1 Draw a box with a single line border from
- line 1 column 1 thru line 5 column 10.
-
- BOX 5,15,10,80,1 Draw a box with a double line border from
- line 5 column 15 thru line 10 column 80.
-
- 7
- SYNTAX OF VERBS
-
- Verb : CAPS
-
- Description: Turn the CAPS LOCK on or off
-
- Syntax : CAPS [ON,OFF]
-
- Examples : CAPS ON Turn the CAPS LOCK on
- CAPS OFF Turn the CAPS LOCK off
-
-
-
-
- Verb : CENTER
-
- Description: Center text on a line
-
- Syntax : CENTER LINE,'TEXT'<,MODIFIER>
-
- Examples : CENTER 5,'HELLO' Center the word hello on line 5
- CENTER 5,'HELLO',REV Center the word hello on line 5 in reverse
- video
-
-
-
-
- Verb : CHAIN
-
- Description: Transfer control to FILENAME
-
- Syntax : CHAIN FILENAME
-
- Examples : CHAIN LESSON2 Transfer program control to the file named
- LESSON2.CBT
-
-
-
-
- Verb : CLS
-
- Description: Clear the screen or any portion of the screen
-
- Syntax : CLS <LINE1,COL1,LINE2,COL2>
-
- LINE1 is the upper line of the area to clear
- COL1 is the upper left column of the area to clear
- LINE2 is the lower line of the area to clear
- COL2 is the lower right column of the area to clear
-
- Examples : CLS Clear the entire screen
- CLS 5,1,10,80 Clear the area surrounded by line 5 column
- 1 and line 10 column 80
-
-
- SYNTAX OF VERBS
-
- Verb : CURSOR
-
- Description: Turn cursor on, off, or create a full block cursor
-
- Syntax : CURSOR [ON,OFF,FULL]
-
- Examples : CURSOR ON Turn cursor on to IBM default of an under-
- line cursor
-
- CURSOR OFF Turn the cursor off
-
- CURSOR FULL Turn on a full block cursor
-
-
-
-
-
- Verb : DEBUG
-
- Description: Turn debugging on or off
-
- Syntax : DEBUG [ON,OFF]
-
- Examples : DEBUG ON Turn debugging on
- DEBUG OFF Turn debugging off
-
-
-
-
- Verb : DISPLAY
-
- Description: Display data on the screen
-
- Syntax : DISPLAY <LINE,COL,> ['TEXT',MEMORY BOX,CHR(XXX)] <,MODIFIER>
-
- Examples : DISPLAY 5,1,'HELLO'
- Display the word HELLO at line 5 column 1
- DISPLAY 5,1,'HELLO',REV
- Display the word HELLO at line 5 column 1 in reverse video
- DISPLAY 5,1,CHR(1)
- Display a smiley face at line 5 column 1
- DISPLAY 5,1,@1
- Display the contents of memory box 1 at line 5 column 1
- DISPLAY 5,1,@1,BLINK
- Display the contents of memory box 1 at line 5 column 1 blinking
-
- DISPLAY @1
- Display the contents of memory box 1 at the current line and
- column
- DISPLAY @1,ULINE
- Display the contents of memory box 1 at the current line and
- column underlined
-
- SYNTAX OF VERBS
-
- DISPLAY 'HELLO'
- Display the word HELLO at the current line and column
- DISPLAY 'HELLO',HIGH
- Display the word HELLO at the current line and column in bright
- video
- DISPLAY CHR(1)
- Display a smiley face at the current line and column
-
-
-
-
- Verb : DO
-
- Description: Transfer control to specified file name. When end of file on
- filename or a return statement is encountered, transfer will
- return to the line following the do statement.
-
- Syntax : DO [ FILENAME | @X
-
- Examples : DO LESSON2 Transfer program control to LESSON2.CBT
- When LESSON2.CBT is done, or a return
- statement is encountered, control will
- return to the file with this do statement,
- one line further in the program.
-
- Examples : DO @23 Transfer program control to the filename
- contained in memory variable #23.
-
-
-
- Verb : DUMP
-
- Description: Dump will print on the print on the printer the following:
- 1) File name and line # dump was call from
- 2) Option text parameter
- 3) ALL memory boxes and their contents
- 4) The current value of FKEY and LENGTH
- 5) All files currently being processed and the
- line #'s to return to.
-
- Syntax : DUMP <'TEXT'>
-
- Examples : DUMP Will dump the above to the printer with no
- optional text
-
- DUMP 'Test dump' Will dump the above to the printer with the
- optional text "Test dump" in the header
-
-
-
-
- Verb : ERASE
-
- Description: Erase will clear the contents of memory boxes
-
- Syntax : ERASE [ALL,@X <TO @Y>]
-
- SYNTAX OF VERBS
-
- Examples : ERASE ALL Erase all memory boxes
- ERASE @1 Erase memory box 1
- ERASE @1 TO @30 Erase memory boxes 1 thru 30
-
-
-
-
- Verb : GOSUB LABEL
-
- Description: Transfer control to specified label. When a return statement
- is encountered, control will return to the line following the
- gosub statement.
-
- Syntax : GOSUB LABEL
-
- Examples : GOSUB GET_ANSWER Transfer program control to the label
- GET_ANSWER. When a return statement, or
- the end of file is encountered, control
- will return to the line following the
- gosub statement.
-
-
-
- Verb : GOTO
-
- Description: GOTO will transfer control to a specified label within the
- CURRENT cbt file
-
- Syntax : GOTO LABEL
-
- Examples : GOTO SCREEN-1 Transfer control in the current cbt lesson
- to the label SCREEN-1
-
-
-
-
- Verb : HALT
-
- Description: Halts execution of CBT
-
- Syntax : HALT
-
- Examples : HALT Stop execution of CBT now
-
-
-
-
- Verb : IF
-
- Description: IF provides a way to do simple testing and take action depending
- on the results of the test
-
- NOTE: If a DO command is the selected CBT command, It must be
- the last command to be executed
-
- Syntax : IF [FKEY,LENGTH,@X] [COMPARE] 'TEXT' ANY VALID CBT COMMAND
- Compare may be one of the following:
- = equal
- >= greater than or equal
- <= less than or equal
- <> not equal
- > greater than
- < less than
-
- Examples : IF FKEY = 13 GOTO PRESSED_RETURN
- If FKEY is equal to 13 program control will transfer to the
- label PRESSED_RETURN
-
- IF LENGTH = 10 DISPLAY 5,1,'10 CHARACTERS' | GOTO DONE
- If LENGTH is equal to 10, the message 10 CHARACTERS will
- be displayed at line 5 column 1 and program control will be
- transferred to the label DONE
-
- IF @1 = '1' CLS | DISPLAY 'DOING LESSON1' | DO LESSON1
- If memory box @1 is equal to a 1, the screen will be cleared,
- the message DOING LESSON1 will be displayed at the current
- SYNTAX OF VERBS
-
- line and column, and the CBT file LESSON1.CBT will begin
- execution.
-
-
- Verb : INKEY
-
- Description: INKEY will accept one character and execution will continue
- INKEY will NOT display the entered character
-
- Syntax : INKEY <LINE,COL,>@X
-
- Examples : INKEY 5,1,@1 Accept one character into memory box #1
- with the cursor at line 5 column 1
-
- INKEY @1 Accept one character into memory box #1
- with the cursor at the current line and
- column
-
-
-
-
- Verb : INPUT
-
- Description: INPUT will accept up to a specified number of characters from
- the operator
-
- Syntax : INPUT <LINE,COL,> LEN,@X
-
- Examples : INPUT 5,1,10,@2 Input up to 10 characters into memory box
- #2 at line 5 column 1
-
- INPUT 10,@2 Input up to 10 characters into memory box
- #2
-
-
-
-
- Verb : JOIN
-
- Description: JOIN is used to combine up to 16 memory boxes into 1 memory box
-
- Syntax : JOIN @1,<@2,...@16>,@17
-
- Examples : JOIN @1,@2,@3,@4,@5 Join memory boxes 1 thru 4 together and
- put the result into memory box 5
-
-
-
-
- Verb : NUM
-
- Description: Turn the NUM LOCK on or off
-
- SYNTAX OF VERBS
-
- Syntax : NUM [ON,OFF]
-
- Examples : NUM ON Turn the NUM LOCK on
- NUM OFF Turn the NUM LOCK off
-
-
-
-
- Verb : PAINT
-
- Description: Paint a portion of the screen in a specified modifier
-
- Syntax : PAINT LINE1,COL1,LINE2,COL2,MODIFIER
-
- LINE1 is the upper line of the area to paint
- COL1 is the upper left column of the area to paint
- LINE2 is the lower line of the area to paint
- COL2 is the lower right column of the area to paint
-
- Examples : PAINT 5,1,10,80,REV Paint the area from line 5 column 1 to
- line 10 column 80 in reverse video
-
-
-
-
- Verb : PRINT
-
- Description: Send data to the printer. Must have a printer on your
- computer.
-
- Syntax : PRINT [PAGE,'text',memory box,CHR(XX)]<;>
-
- PAGE will cause a page advance
- TEXT is any text enclosed in single quotes
- MEMORY BOX is any memory variable
- CHR(XXX) is any value from 0 to 255
- ; will cause the printer to NOT advance to the next line
-
- Examples : PRINT 'Hello' Print the word hello on the printer
- and advance to the next line
-
- PRINT @1; Print the contents of memory variable
- #1 and stay on the same line
-
- PRINT CHR(65) Print a letter A on the printer and
- advance to the next line
-
- PRINT PAGE Will cause an advance to the next page
-
-
-
-
- Verb : REPORT
-
- Description: Send a file to the printer. Must have a printer on your
- computer.
-
- Syntax : REPORT FILENAME.EXT
-
- Examples : REPORT DOUG.TXT Print the file 'doug.txt' on the
- printer.
-
-
-
-
- Verb : RESTORE
-
- Description: RESTORE will restore the memory boxes from a file that what
- created using the SAVE command. If no extention is used on the
- filename, an extension of .MEM is assumed
-
- Syntax : RESTORE FILENAME
-
- Examples : RESTORE B4MENU Restore all memory boxes from the file
- called B4MENU.MEM
-
-
-
-
- Verb : RETURN
-
- Description: RETURN causes an immediate exit from a DO file
-
- Syntax : RETURN
-
- Examples : RETURN Exit from this DO file now
-
-
-
-
- Verb : SAVE
-
- Description: SAVE will save all the memory boxes to a disk file can be used
- SYNTAX OF VERBS
-
- with the RESTORE command. If no extention is used on the
- filename, an extension of .MEM is assumed
-
- Syntax : SAVE FILENAME
-
- Examples : SAVE B4MENU Salve all memory boxes to the disk file
- called B4MENU.MEM
-
-
-
-
- Verb : SCREEN
-
- Description: SCREEN will display the contents of filename at the current
- line and column on the screen. If no extension is given, it is
- assumed to be .SCR
-
- Syntax : SCREEN FILENAME
-
- Examples : SCREEN MENU Causes the file MENU.SCR to be displayed
- at the current line and column
-
-
-
-
- Verb : SET
-
- Description: SET will allow you to control certain operating parameters
- of CBT
-
- Syntax : SET PARAMETER [ON,OFF]
-
- Examples : SET ECHO ON Causes all characters typed in response
- to an input statement to be displayed as
- they are typed in. This is the default.
-
- SET ECHO OFF Causes all characters typed in response
- to an input statement not to be displayed
- as they are typed in.
-
- Valid Parameters
- PARAMETER ON OFF
- ----------------------------------------------------------------------------
- ECHO Causes entered characters Entered characters are not
- to be displayed. displayed.
-
- RETURN Allows the enter key to The enter key will not be
- terminate input and inkey. allowed to terminate input and
- inkey.
-
- ESCAPE Allows the escape key to The escape key will not be
- terminate input and inkey. allowed to terminate input and
- inkey.
-
- F1 thru F10 Allows the corresponding Does not allow the corresponding
- HOME, UP, key to terminate input and key to terminate input and
- PGUP, LEFT, inkey. inkey.
- RIGHT, END,
- DOWN, PGDN
-
- FKEYS Sets all keys on. Sets just the ENTER key on.
-
- AUTOTAB Enter is not necessary Must press enter to terminate
- when an input field is an input statemenu.
- filled.
-
-
-
- Verb : STORE
-
- Description: STORE will enter text into a memory box
-
- Syntax : STORE 'TEXT' TO @X
-
- Examples : STORE 'HELLO' TO @1 Put the word HELLO into memory box #1
-
-
-
-
- Verb : TYPE
-
- Description: TYPE allows text to be displayed on the screen as if an operator
- were typing it in, character at a time.
-
- Syntax : TYPE LINE,COL,'TEXT',DELAY <,MODIFIER>
-
- Examples : TYPE 10,15,'HELLO TO ALL MY READERS',50
- Display the message HELLO TO ALL MY READERS at line 10 column
- 15 with a 50 millisecond delay between characters
-
- TYPE 10,15,'HELLO TO ALL MY READERS',50,BLINK
- Display the message HELLO TO ALL MY READERS at line 10 column
- 15 with a 50 millisecond delay between characters with each
- character blinking
-
-
-
- Verb : VERIFY
-
- Description: VERIFY is used to make sure the operator types in what you want
- them to type in. Checking is done on a character by character
- basis.
-
- Syntax : VERIFY LINE,COL,'TEXT',ERROR_MESSAGE,LINE2,COL2
-
- ERROR_MESSAGE is displayed to the operator at LINE2, COLUMN2
- whenever they type a character that does not occure in the
- same spot in 'TEXT'
- The BACKSPACE key may be embedded into text by using a \8
-
- Examples : VERIFY 1,18,'1P3BM54A5DD281506',@1,14,10
- Makes sure the operator types in 1P3BM54A5DD281506 exactly as
- it appears. The error message that is in @1 will appear at
- line 14 column 10 EVERY time they type in an incorrect
- character
-
- Examples : VERIFY 1,18,'1P3BM54A5DD281506','NO SIR',14,10
- Makes sure the operator types in 1P3BM54A5DD281506 exactly as
- SYNTAX OF VERBS
-
- it appears. The error message 'NO SIR' will appear at line 14
- column 10 EVERY time they type in an incorrect character
-
-
-
-
- Verb : WAIT
-
- Description: WAIT will suspend execution of the lesson
-
- Syntax : WAIT <TIME>
-
- Examples : WAIT 5 Will suspend execution for 5 seconds
-
- SYNTAX OF VERBS
-
- WAIT Causes a message 'Press any key to continue'
- to appear at the current line and column
- and execution will be suspended until the
- operator presses any key
- 17
- SYNTAX REFERENCE
-
- Verb Syntax
-
- AT AT Line,column
- BEEP BEEP
- BOX BOX LINE1,COL1,LINE2,COL2,BORDER
- CAPS CAPS [ON,OFF]
- CENTER CENTER LINE,'TEXT'<,MODIFIER>
- CHAIN CHAIN FILENAME
- CLS CLS <LINE1,COL1,LINE2,COL2>
- CURSOR CURSOR [ON,OFF,FULL]
- DEBUG DEBUG [ON,OFF]
- DISPLAY DISPLAY <LINE,COL,> ['TEXT',MEMORY BOX,CHR(XXX)] <,MODIFIER>
- DO DO FILENAME
- DUMP DUMP <'TEXT'>
- ERASE ERASE [ALL,@X <TO @Y>]
- GOSUB GOSUB LABEL
- GOTO GOTO LABEL
- HALT HALT
- IF IF [FKEY,LENGTH,@X] [COMPARE TYPE] 'TEXT' ANY VALID CBT COMMAND
- INKEY INKEY <LINE,COL,>@X
- INPUT INPUT <LINE,COL,> LEN,@X
- JOIN JOIN @1,<@2,...@16>,@17
- NUM NUM [ON,OFF]
- PAINT PAINT LINE1,COL1,LINE2,COL2,MODIFIER
- PRINT PRINT [PAGE,'text',memory box,CHR(XX)]<;>
- REPORT REPORT FILENAME.EXT
- RESTORE RESTORE FILENAME
- RETURN RETURN
- SAVE SAVE FILENAME
- SCREEN SCREEN FILENAME
- SET SET PARAMETER [ON,OFF]
- STORE STORE 'TEXT' TO @X
- TYPE TYPE LINE,COL,'TEXT',DELAY <,MODIFIER>
- VERIFY VERIFY LINE,COL,'TEXT',ERROR_MESSAGE,LINE2,COL2
- WAIT WAIT <TIME>