home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
d
/
demos301.zip
/
DEMOSYS.REF
< prev
next >
Wrap
Text File
|
1993-01-15
|
63KB
|
1,600 lines
DEMOSYS.REF Last revised 01/15/93 Page 1
The DEMO System
Wayne Software
113 Sheffield St.
Silver Spring, MD 20910
Reference manual
--------------------------------------------------------------------------------
Table of contents
Table of contents ............................................... 1
Command-line options:
DEMOMAKE.EXE .................................................. 3
The DEMO System viewer ........................................ 3
Control card references ......................................... 4
Statement reference:
- filename [ description ] .................................. 5
- *ref [ description ] ...................................... 5
- (GLOBAL) [ description ] .................................. 6
- (ONCE) [ description ] .................................... 6
- (SETn) [ description ] .................................... 6
- @label [ description ] .................................... 7
/., ./ ..................................................... 7
+ filename .................................................. 7
Comments .................................................... 7
DATADIR [ subdirectory ] .................................... 8
DO name [ parms ]
DO (DUMMY) [ parms ] ........................................ 8
MACRO name [ REUSE | SKIP ], MEND ........................... 8
SET statements:
SET CASE ON, SET CASE OFF ................................... 9
SET CLS ON, SET CLS OFF ..................................... 9
SET COLOR settings .......................................... 10
SET CURSOR string ........................................... 10
SET KEYS CLEAR .............................................. 11
SET KEYS SETn ............................................... 11
SET LOGO string ............................................. 11
SET MONO settings ........................................... 11
SET SETTINGS SETn ........................................... 12
SET TOP screen .............................................. 12
DEMOSYS.REF Last revised 01/15/93 Page 2
Action commands:
ASSIGN ^Evar^ string ........................................ 13
BEEP ........................................................ 13
BUFFER [ chars ] ............................................ 14
CALL screen [ KEYn | parms ] ................................ 13
CD directory ................................................ 14
CDD drive:directory ......................................... 14
CLS ......................................................... 15
COPY file1 file2 ............................................ 15
DATA ........................................................ 15
DELETE filename ............................................. 15
DISPLAY COLOR, DISPLAY MONO, DISPLAY TOGGLE ................. 15
DRIVE letter ................................................ 15
ECHO [ string[@] ] .......................................... 16
ECHOA [ string[@] ] ......................................... 16
FIELD [ TOP | FIRST | -999 to 999 | BOTTOM | LAST ] ......... 16
GOTO scren [ KEYn | CLEAR | parms ] ......................... 17
KEYPRESS .................................................... 17
LOADLOGO ^Evar^ char_count .................................. 18
LOADLOGO CLEAR .............................................. 19
LOCATE row col .............................................. 19
MD directory ................................................ 20
NONE ........................................................ 20
PAUSE [ seconds ] ........................................... 21
PAUSEA [ seconds ] .......................................... 21
PAUSE BREAK ON, PAUSE BREAK OFF ............................. 21
PAUSE DEMO seconds .......................................... 21
PLAY string ................................................. 22
PLAY ON, PLAY OFF ........................................... 22
POP [ TOP | 1 to 20 | KEYn ] ................................ 23
PROMPT ^Evar^ pattern string ................................ 24
PROMPTA ^Evar^ pattern string ............................... 25
QUIT [ return_code ] ........................................ 26
RD directory ................................................ 27
REDRAW ...................................................... 27
RUN [ string ] .............................................. 28
RUNA [ string ] ............................................. 29
SAVE filename ............................................... 29
SCREEN [ TOP | FIRST | -999 to 999 | BOTTOM | LAST ] ........ 30
WRITE filename string ....................................... 31
KEY statement ................................................. 32
Miscellaneous string concepts ................................. 33
Environental variables (^Evar^) ............................. 34
^ control codes ............................................. 35
Primary vs alternate screens ................................ 36
System maximums ............................................... 36
DEMOSYS.REF Last revised 01/15/93 Page 3
--------------------------------------------------------------------------------
Command-line options
DEMOMAKE.EXE syntax:
DEMOMAKE ctlname exename [ /OVERWRITE ] [ /SCAN ] [ /Xstring ]
[ /Q ] [ /? ]
where:
"ctlname" is the name of the main control file that you want to process. The
main control file can include links to other control files if desired Drive and
path information can be provided if desired.
"exename" is the name of the self-viewing file you want to create. The default
extension is "EXE". Typically, the base name will be the same as the ctlname.
Drive and path information can be provided if desired.
"/OVERWRITE" says to overwrite the exename file if any is found. Otherwise, if
found, you'll be prompted as to whether you want to overwrite it.
"/SCAN" is used to have the program review your control files without actually
checking on any of the screen files (either imbedded or external). This does
not produce an EXE file but it's a useful way of quickly reviewing the validity
of your file.
"/Xstring" is used to protect your control file from being regenerated by the
DEMOSAVE program (available to registered users only). The same string has to
be provided when DEMOSAVE is run.
"/Q" says to not play any of the PLAY commands within the file. Normally, they
are all played during compilation in order to make sure they are valid. In
case you forget, you can also press the letter "Q" during compilation to turn
it off.
"/?" or "/HELP" or "HELP" gives you syntactical information about how to use the
command.
The DEMO System viewer syntax:
exename [ /M ] [ /Q ] [ /? ]
where:
"exename" is the name of the self-viewing file created by DEMOMAKE.EXE.
"/M" says to use the monochrome (or alternate) color set. The DEMO System
defaults to the color set.
"/Q" says to skip all BEEP and PLAY statements.
"/?" or "/HELP" or "HELP" gives you syntactical information about how to use the
command.
DEMOSYS.REF Last revised 01/15/93 Page 4
--------------------------------------------------------------------------------
Control Card Reference
Descriptions below are separated into five sections:
Statement Reference: Commands which are not limited to screen pages.
These include Macros, page references, and some other commands.
SET statements: Commands which are defined once for every screen page.
Action commands: Commands which can appear on their own in some types
of screen pages or else in KEY commands.
KEY statements: Commands which are activated by the user pressing a
given key on the keyboard.
Miscellaneous string ideas: Things like ^ codes and environmental variables.
Note that within The DEMO System viewer, actions happen in a predictable order.
This order is as follows:
(1) All SET statements are executed. The SET LOGO statement is not acted
upon until later. If SET CLS ON is active, the screen is cleared.
(2) The text screen (if any) is displayed.
(3) The SET LOGO statement (if any) is activated; writing over any text that
is already on the screen.
(4) Any action commands are activated.
(5) Any KEY commands are activated.
DEMOSYS.REF Last revised 01/15/93 Page 5
--------------------------------------------------------------------------------
Statement Reference
- filename [ description ]
Defines a page whose display screen is stored in an external file. The filename
can include drive and path information if desired. Otherwise, the file will be
looked for in your default subdirectory unless a DATADIR statement appears.
Note that even if drive/path information is coded, the related CALL or GOTO
statement should not include this drive/path information.
All filenames (minus drive/path information) must be unique.
These pages can include: SET statements
Action commands
KEY statements
*******************
- *ref [ description ]
Defines a page whose display screen is imbedded within /. ... ./ lines.
Example:
- *001 Testing
SET KEY (ESC) POP
/.
Sample screen
^C2 Hi! ^C0
./
The DEMOMAKE program actually requires that all display screens to be stored as
external files. As a result, when it encounters imbedded screens, it
transparently writes them out to your default drive and subdirectory under the
names ~DEMOINT.nnn (where "nnn" is a three-digit number assigned sequentially).
These files are then read back in during the second pass and then deleted. Due
to this, imbedded files have to be processed twice and will be slower to compile
than non-imbedded files.
Because of this rewriting, the use of the ^EFNAME^ environmental variable with
an imbedded screen will show the file name to be ~DEMOINT.nnn, not the label
you assigned it.
All references must be unique.
These pages can include: SET statements
Action commands
KEY statements
DEMOSYS.REF Last revised 01/15/93 Page 6
*******************
- (GLOBAL) [ description ]
Allows you to establish default KEY and SET settings. Any KEY or SET statements
that appear before you first screen page are presumed to be within (GLOBAL).
The (GLOBAL) statement automatically resets all previously-defined (GLOBAL) KEY
settings but does not affect any (GLOBAL) SET settings.
The (GLOBAL) statement affects all regular page references which follow it.
You cannot include any action commands within a (GLOBAL) definition.
These pages can include: SET statements
KEY statements
*******************
- (ONCE) [ description ]
Establishes a set of commands that is only executed once, at the start of the
program. Typically, the use of this is confined to LOADLOGO and associated DATA
statements. For menuing systems, you may find it desirable to put a DELETE
statement in this section.
Note that the (ONCE) page counts as a page and can be used (usually
accidentally) as a destination for SCREEN, CALL, and GOTO commands.
These pages can include: Action commands
*******************
- (SETn) [ description ]
Allows you to establish up to 10 sets of KEY and SET defaults. "n" has to be a
digit from "0" to "9".
The (SETn) KEY settings are invoked by using the "SET KEY SETn" command. The
(SETn) SET settings are invoked by using the "SET SETTINGS SETn" command.
You have to define the (SETn) before you use it. You can re-specify the (SETn)
settings if you want. You can define (SETn) sections in any order; you don't
have to define (SET0) before you define (SET1).
Action commands appearing within a (SETn) definition are ignored (unlike in
(GLOBAL) definitions where they generate errors).
These pages can include: SET statements
KEY statements
DEMOSYS.REF Last revised 01/15/93 Page 7
*******************
- @label [ description ]
Establishes a page with no associated screen file. Is typically used for
prompt or action-only screens, setting up buffers, etc.
Labels are truncated at 12 characters including the "@" character.
These pages can include: SET statements
Action commands
*******************
/.
...
./
Defines the screen text for any page with imbedded screen text. The "./"
statement must appear by itself on the control line; comments are not allowed.
*******************
+ filename
Says to pick up more control statements from another file. Can include drive
and path information if desired.
*******************
Comments
The DEMO System ignores any blank lines as well as any lines that begin with the
following characters:
: (colon)
; (semi-colon)
' (single quote)
Comments can also be included on lines after regular commands; precede the
comment with "/*" as in:
SET KEY (ESC) GOTO SCRN.001 /* Takes the user to the main menu
The use of comments is always recommended.
DEMOSYS.REF Last revised 01/15/93 Page 8
*******************
DATADIR [ subdirectory ]
Specifies the subdirectory location of all file references that follow. This
statement can appear anywhere including within page screen definitions (but not
within the text of the screen). The DATADIR setting remains in effect until
another DATADIR setting is encountered.
If subdirectory is not provided, files will be looked for in your default
subdirectory.
You can always hard-code the paths in all of your file references but it's
easier to use the DATADIR command.
*******************
DO name [ parms ]
DO (DUMMY) [ parms ]
Executes a previously-defined Macro statement.
Up to 9 words can be passed in and these will be substituted in for any
references to &1 to &9 during compilation. (If 10 or more words are provided,
the extra words are all stuck in &0.) These variables remain set until another
DO statement is encountered.
DO (DUMMY) is used to clear or reset Macro variables. No action other than the
variable clearing goes on with this Macro statement. You can, therefore, have
&1 to &9 (and &0) defined even without having any associated MACRO statement.
*******************
MACRO name [ REUSE | SKIP ]
...
MEND
Defines a Macro. This code can include any statement other than another Macro
definition. The Macro block must end with a MEND statement, which must appear
by itself on a control line. (The MEND statement can include comments though.)
Macro names must be unique unless "REUSE" or "SKIP" is specified. If the
definition already exists and "REUSE" is specified, the new definition will
replace the old. If the definition already exists and "SKIP" is specified, the
new definition will be ignored (although it does show up in the count of
macros).
The Macro is actually invoked with a DO command.
DEMOSYS.REF Last revised 01/15/93 Page 9
--------------------------------------------------------------------------------
SET Statements
Each SET statement is defined once per display screen. (One exception: SET
KEYS SETn and SET SETTINGS SETn can occur multiple times.) If the same SET
statement appears more than once in a given page, the latter definition always
wins. Keep this in mind; you can't have the program be case-sensitive for some
keys and case-insensitive for others on the same screen.
*******************
SET CASE ON
SET CASE OFF
Determines whether the case of the user's input matters when processing a KEY
statement. If SET CASE ON is in effect, "g" will be treated differently than
"G".
The default setting is SET CASE OFF.
*******************
SET CLS ON
SET CLS OFF
Determines whether the screen is automatically cleared when a new text screen
(confined to "- filename" and "- *ref" statements) is loaded.
The default setting is SET CLS ON.
DEMOSYS.REF Last revised 01/15/93 Page 10
*******************
SET COLOR settings
Allows you to define up to 8 color "sets" (numbered ^C0 to ^C7) which you can
use in most displayed text. Each color set consists of 1 to 8 three-digit
numbers. The first three-digit number defines ^C0, the eighth defines ^C7.
Each three digit number consists of two digits for a foreground color and one
digit for the background color. The foreground color must be zero-filled if
it's only one digit in length (use "07" instead of "7").
Foreground colors:
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 = light yellow
7 = white 15 = bright white
Adding 16 to any color will make the text blink.
Background colors can consist of 0 to 7 above.
Bright white on blue, for example, would be "151".
The default setting is SET COLOR 151 154 152 117 097 153 001 157
All screen text lines are defined to use color set 0. You can imbed color
control codes anywhere in your text to get around this. The SET COLOR settings
automatically come up by default unless /M is passed into the viewer. You can
switch to the monochrome settings within your program by issuing the command
"DISPLAY MONO" or "DISPLAY TOGGLE".
Other than the text screen lines, most text usings the color of the last
string printed as the default color.
*******************
SET CURSOR string
This establishes the shape and color of the screen's cursor. This is typically
applicable only for full-screen operations.
The cursor definition string can include ^ controls. For example:
SET CURSOR ^C2(^T10^
The default setting is SET CURSOR _
DEMOSYS.REF Last revised 01/15/93 Page 11
*******************
SET KEYS CLEAR
Clears any key definitions inherited from the (GLOBAL) level.
*******************
SET KEYS SETn
Grabs all KEY settings in (SETn) and uses them for this screen. (SETn) has to
be previously defined.
The settings are added in place, leaving KEY statements before and after as they
were. If the (SETn) KEY setting is already defined before the SET KEYS SETn
statement is encountered, the first definition wins. Similarly, KEY statements
which appear after a SET KEYS SETn statement lose precedence over the
definitions in SET KEYS SETn.
The SET SETTINGS SETn command grabs all SET settings in (SETn).
*******************
SET LOGO string
Establishes a logo or byline that appears somewhere on the screen. This is
typically used to identify the fact that the person is running a demo, not the
real product. The logo prints over any text that is already on the screen.
The logo string can include ^ controls. This allows you to have the logo
appearing on multiple logo lines on your screen although only one SET LOGO is
accepted. For example:
SET LOGO ^C1^P1,35This is a logo^P25,30appearing on top and bottom
*******************
SET MONO settings
Defines the monochrome (or alternate) screen colors. See the description of
colors in the SET COLOR command description.
In actuality, COLOR and MONO just refers to a primary and secondary set of
screen colors. You could define MONO to be color as well.
The default setting is SET MONO 150 070 007 157 150 070 007 157
DEMOSYS.REF Last revised 01/15/93 Page 12
*******************
SET SETTINGS SETn
Grabs all SET settings in (SETn) and uses them for this screen. (SETn) has to
be previously defined.
The settings are added in place, leaving SET statements before and after as they
were. If the (SETn) SET setting is already defined before the SET SETTINGS SETn
statement is encountered, the first definition wins. Similarly, SET statements
which appear after a SET SETTINGS SETn statement lose precedence over the
definitions in SET SETTINGS SETn.
The SET KEYS SETn command grabs all KEY settings in (SETn).
*******************
SET TOP screen
Determines which screen the system will bring up if a "POP TOP" statement is
executed. Is also the screen that's brought up if a POP statement tries to POP
further back than the CALL stack provides.
Defaults to the first real text screen in your control file.
DEMOSYS.REF Last revised 01/15/93 Page 13
--------------------------------------------------------------------------------
Action commands
ASSIGN ^Evar^ [ string ]
Assigns a value to a DOS environmental variable or to any of the user-defined
variables in The DEMO System. For DOS environmental variables, care should be
taken that you don't expand the variable too much and cause the environment area
to explode.
Note that redefining DOS environmental variables only works until you quit to
DOS, at which time they return to their original settings.
The assignment string can include environmental variables.
If the assignment string is left off, the value of ^Evar^ will be null.
*******************
BEEP
Beeps. You can be more creative using PLAY commands though. BEEP is useful if
you want to alert people to invalid keystrokes:
KEY (ELSE) BEEP
*******************
BUFFER [ chars ]
Buffers one or more characters. These characters are then read in when The DEMO
System encounters any keypress situation.
Leaving off the parameter results in the buffer being immediately cleared.
One of the characters can be (LASTKEY) which is the value of the last key
pressed. Passing this then clears the value of (LASTKEY). This is typically
used for screens that you want any keypress to advance to the next screen but
you still want to use the keypress for some later movement.
Buffering is affected by these commands:
PAUSE BREAK ON
PAUSE BREAK OFF
PAUSE DELAY seconds
DEMOSYS.REF Last revised 01/15/93 Page 14
*******************
CALL screen [ KEYn | parms ]
Passes control to another screen (or label) with the intention of having a POP
command later on returning control to the current screen.
The KEYn parameter says to position the cursor at input key "n" when the next
screen in loaded.
The optional parameters allow you to pass up to 9 values into the next screen.
These values are stored in environmental variables ^E1^ to ^E9^. These keys
remain set until the next CALL or GOTO statement is encountered which also
passes parameters.
The parms can include ^ control items and environmental variables.
*******************
CD directory
Changes the default subdirectory. If that directory does not exist, an error
message will be displayed but the program will continue on.
If the subdirectory includes drive information, the default subdirectory on
*that* drive, not the default drive, will be changed.
The directory can be an environmental variable.
See also the CDD, DRIVE, MD, and RD commands.
*******************
CDD drive:directory
Changes the default drive and subdirectory. (Essentially the same thing as
issue a DRIVE command, followed by a CD command.) If that directory does not
exist, an error message will be displayed but the program will continue on.
The drive:directory can be an environmental variable.
See also the CD, DRIVE, MD, and RD commands.
DEMOSYS.REF Last revised 01/15/93 Page 15
*******************
CLS
Clears the primary screen.
*******************
COPY file1 file2
Copies one file (file1) under another file (file2). The destination file is
replaced if it exists already. Either filename can include drive and path
information.
Either file can be an environmental variable.
*******************
DATA ...
Statement which, so far, is only used with the LOADLOGO command.
*******************
DELETE filename
Deletes a file. The filename can include drive and path information.
The file name can be an environmental variable.
*******************
DISPLAY COLOR
DISPLAY MONO
DISPLAY TOGGLE
Sets the default color setting to either the SET COLOR set or the SET MONO (or
alternate) set. DISPLAY TOGGLE toggles between the two (COLOR becomes MONO and
vice versa). This is frequently used in a key definition:
KEY (A-M) DISPLAY MONO
KEY (A-C) DISPLAY COLOR
Note that the color changes do not take effect until the screen is redraw. You
may want to handle display toggling in a label since that will redraw the
screen automatically when done.
*******************
DRIVE letter
Sets the default drive as "letter". The drive designation *cannot* be an
environmental variable.
See also the CD, CDD, MD, and RD commands.
DEMOSYS.REF Last revised 01/15/93 Page 16
*******************
ECHO [ string[@] ]
Prints a string to the primary screen. The string can include environmental
variables and control codes.
If a "@" immediately follows the string, The DEMO System will not do a carriage
return/line feed after the string.
Note that it's possible to cause a system failure by specifying a string that
will not fit within the designated line. Exercise some judgment when putting
long strings on the right side of the screen.
*******************
ECHOA [ string[@] ]
Prints a string to the alternate screen. See the ECHO action command for
further details.
*******************
FIELD [ TOP | FIRST | -999 to 999 | BOTTOM | LAST ]
Moves the cursor to a different input field on the current screen. Except for
TOP (or FIRST) and BOTTOM (or LAST), the new field position cannot be expressed
in absolute terms. Instead, you specify the relative position to move the
cursor.
This command is typically used when designing full-screen systems. For example:
SET KEY (RIGHT) FIELD 1
SET KEY (LEFT) FIELD -1
SET KEY (HOME) FIELD TOP
SET KEY (END) FIELD BOTTOM
The command is ignored if you have less than two input fields on a given screen.
DEMOSYS.REF Last revised 01/15/93 Page 17
*******************
GOTO screen [ KEYn | CLEAR | parms ]
Passes control to another screen (or label) with the intention of *not*
returning control to the current screen.
The KEYn parameter says to position the cursor at input key "n" when the next
screen in loaded.
The CLEAR parameter says to clear the CALL return stack when the jump is made.
The optional parameters allow you to pass up to 9 values into the next screen.
These values are stored in environmental variables ^E1^ to ^E9^. These keys
remain set until the next CALL or GOTO statement is encountered which also
passes parameters.
Note that a GOTO statement on its own (outside a KEY statement) will result in
the current screen being closed and must be followed by a new page declaration
or else the end of the file.
The parms can include ^ control items and environmental variables.
*******************
KEYPRESS
Pauses and waits for a user input. KEYPRESS is automatically executed for a
screen with an associated text page.
Note that a KEYPRESS statement on its own (outside a KEY statement) will result
in the current screen being closed and must be followed by a new page
declaration or else the end of the file.
Example:
- @TESTING
KEY (UP) ECHO Pressed UP
KEY (DOWN) ECHO Pressed DOWN
KEY (ESC) QUIT
ECHO Press either UP or DOWN or ESC
KEYPRESS
(Remember that action commands are always executed before KEY statements so the
ECHO will show up, then the KEYPRESS will be acted upon, and the result will
be used by the KEY statements.)
DEMOSYS.REF Last revised 01/15/93 Page 18
*******************
LOADLOGO ^Evar^ char_count
DATA ...
DATA ...
A technique for loading graphics characters over the VGA character set so you
can make things like logos or special boxes while within the text environment.
The technique itself has been explained in several technical articles and
involves the use of interrupts and such. It will not be explained here other
than the explain the format used within this program.
The ^Evar^ parameter is the variable that will be assigned the characters that
constitute the redefined characters. If you want to define several logos, each
of which can consist of one or more characters together, you would need to use
several LOADLOGO statements. Once the logo has been loaded, you can use the
^Evar^ in ECHO, SET LOGO, etc statements.
The char_count indicates how many characters put together constitute this logo.
There has to be one DATA line for every character.
The DATA statements consist of 17 values. The first value is the ASCII value
that the character will replace (e.g. 211 for CHR$(211)). The next values are
the decimal representation for each line of pixels. VGA fonts are 16 pixels
high so there are 16 values after the decimal representation.
The DATA statements must immediately follow the LOADLOAD statement. Blank
lines and comments are not allowed.
The following example defines a bat silhouette as ASCII characters 221, 222, and
224.
LOADLOGO ^EBATSYMBOL^ 3
DATA 221,0,24,28,60,62,63,127,127,127,255,255,255,239,206,132,128
DATA 222,66,126,126,126,126,255,255,255,255,255,255,255,255,126,60,24
DATA 224,0,24,56,60,124,252,254,254,254,255,255,255,247,115,33,1
LOADLOGO is ignored if the user does not have a VGA card. In that case, the
environmental variable will be set to null.
You typically will not want to define the logo multiple times in one program.
Doing so causes the screen to flicker. It's usually best to use the (ONCE)
screen definition to load the logo when The DEMO System viewer is loaded and
then not do it again.
Some applications (like PC Tools and the Norton Utilities) may redefine the
character set on their own. In this case, the environmental variable will still
be set but it will display weird characters instead of what you want. Notice
which programs do this and isolate the RUN commands that are affected. If you
have a command like SET LOGO which uses the logo, you will want to either
re-load the logo again (using the LOADLOGO command) or redefine the
environmental variable to be null.
DEMOSYS.REF Last revised 01/15/93 Page 19
*******************
LOADLOGO CLEAR
This command clears any VGA character redefinitions that you've made. This
insures that the user's DOS session won't have weird little graphics characters
showing up at odd times.
If the characters actually remain on the screen after LOADLOGO CLEAR is issued,
you will probably want to issue a CLS command to clear the screen.
LOADLOGO CLEAR does not affect the contents of the environmental variable you
defined in the LOADLOGO command. If you print that string after using LOADLOGO
CLEAR, that string will show up as the original DOS characters, not the
redefined ones. You may want to assign it to null if you want to continue on.
The LOADLOGO CLEAR statement is ignored if the user does not have a VGA card or
if they didn't set any symbols in the first place.
*******************
LOCATE row col
Positions the cursor at a given row and column on the screen. Positioning on
the screen starts with the upper left corner being 1, 1 and the lower right
corner being 25, 80.
Do not use commas between the positions.
You can use the ^Prow,col control codes to position most text instead of using
the LOCATE command.
DEMOSYS.REF Last revised 01/15/93 Page 20
*******************
MD directory
Makes a new subdirectory. If that subdirectory cannot be created, an error
message will be displayed but the program will continue on.
The directory can be an environmental variable and it can include drive
information if desired.
See also the CD, CDD, DRIVE, and RD commands.
*******************
NONE
This is a special null-operation command which is typically only used in
KEY statements. The purpose is to nullify a key assignment made by a (SETn) or
GLOBAL statement.
For (SETn) statements, the NONE assignment has to be made *before* the SET VARS
SETn statement.
Example:
- (GLOBAL)
KEY (UP) FIELD -5
KEY (DOWN) FIELD 5
... (a half-dozen key assignments you like) ...
- (SET1)
KEY (LEFT) FIELD -1
KEY (RIGHT) FIELD 1
... (a dozen key assignments you like) ...
- *001 Testing
KEY (UP) NONE /* Note that these keys will do nothing now
KEY (DOWN) NONE
SET KEYS SET1
DEMOSYS.REF Last revised 01/15/93 Page 21
*******************
PAUSE [ seconds ]
Waits for either the specified number of seconds or until the user presses any
key. Seconds can be expressed in tenths and must be between 0.1 and 600.
The activity is done on the primary screen.
*******************
PAUSEA [ seconds ]
Same as "PAUSE [ seconds ]" but activity is done on the alternate screen.
*******************
PAUSE BREAK ON
PAUSE BREAK OFF
Determines whether someone can escape (using the Esc key) out of a self-running
demo.
Defaults to PAUSE BREAK ON (the user can escape out).
*******************
PAUSE DEMO seconds
Determines how many seconds the system should delay between buffered keystrokes
in a self-running demo. The user can skip through the pause by pressing any
keyboard key (not mouse key).
Seconds can be expressed in tenths and must be between 0.1 and 600.
Defaults to PAUSE DEMO 1.
DEMOSYS.REF Last revised 01/15/93 Page 22
*******************
PLAY string
The PLAY command plays a string of sounds using QuickBASIC's PLAY command.
There are lots of characters that can appear in the PLAY string. The following
chart summarizes them but you should use a BASIC manual for fuller explanations
if necessary:
A to G Plays note in range A to G: "#" after note implies
a sharp while "-" afterward implies a flat
L n Sets the default length of each note (from 1 [whole
note] to 64 [very short note]). You can also specify
the length after each note itself, e.g. "A16".
MN Music normal. Each note plays for 7/8's its time.
ML Music legato. Each note plays for full period.
MS Music staccato. Each note plays 3/4 of its time.
P n Specifies a pause of length 1 to 64.
T n Specifies tempo (number of L 4 quarter notes played
in one minute). Range can be 32 to 255, default 120.
MF Music foreground. The program waits until the notes
finish before going on.
MB Music background. The notes start playing and the
user can continue to press keys while the music plays.
MB is the default in The DEMO System.
. A period after the note causes the note to play
3/2's of it's time.
# or + These characters after the note cause it to be sharped.
- A minus after the note causes it to be flatted.
The first few notes of Beethoven's Fifth Symphony is the following:
PLAY mb t180 o2 p2 p8 l8 ggg l2 e- p24 p8 l8 fff l2 d
PLAY strings are played during compilation in order to check them for errors.
You can turn off this verification by using DEMOMAKE's /Q option or else by
pressing Q during compilation. Note that failure to verify the PLAY strings at
some point may result in non-recoverable execution errors.
*******************
PLAY ON
PLAY OFF
The PLAY OFF command turns off any BEEP and PLAY commands within your
demonstration. The PLAY ON command turns them back on.
PLAY ON is the default.
DEMOSYS.REF Last revised 01/15/93 Page 23
*******************
POP [ TOP | 1 to 20 | KEYn ]
Returns to the statement after a prior CALL statement. Relative to GOTO
statements, POP commands make screen levels easier to keep track of and allows
you to designate some screens or sets of screens as being common to several
demonstrations.
You can instruct POP to return you to any of the last 20 screens that you made
CALL's from. You can also instruct it to return to the screen defined as your
"top" screen (see SET TOP), whether that screen had used a CALL or not.
If you want to return to the prior CALL, you can specify which keyboard input
item the cursor should rest on. Otherwise, the program will automatically
select the first item on the screen. For example:
- *001 Central menu
KEY (LEFT) FIELD -1
KEY (RIGHT) FIELD 1
KEY @1 CALL @002
KEY @2 CALL @003
KEY @3 CALL @004
KEY (ESC) QUIT
/.
Select one: ^K First field ^K Second field ^K Third field
or (ESC) to quit
./
- @002 First field
ECHO ^P10,1^C1Made it to ^C4first^C1 field's choice
ECHO Press a key
PAUSE
POP /* Returns to first field by default
- @003 Second field
ECHO ^P10,1^C2Made it to ^C4second^C2 field's choice
ECHO Press a key
PAUSE
POP KEY2 /* Will return user to the "Second field" field
- @004 Third field
ECHO ^P10,1^C3Made it to ^C4third^C3 field's choice
ECHO Press a key
PAUSE
POP KEY3 /* Will return user to the "Third field" field
Unlike with GOTO and CALL, you cannot pass an environmental variable (like
KEY^EFIELD^) into a POP command.
Doing a POP from the TOP level is the same thing as QUIT.
Note that a POP statement on its own (outside a KEY statement) will result in
the current screen being closed and must be followed by a new page declaration
or else the end of the file.
DEMOSYS.REF Last revised 01/15/93 Page 24
*******************
PROMPT ^Evar^ pattern string
The PROMPT command allows you to ask the user for a response. This response is
put into an environmental variable which can then be displayed, written to a
file, etc. The prompt itself appears on the primary screen.
The PROMPT command consists of three parts:
* The environmental variable to use
* The pattern that the input must adhere to
* The prompt that the user sees and responds to
The pattern may consist of any of the following special patterns:
FILESPEC Any valid DOS file specification. Note that DOS
considers "ABASDBASBDBASBD" to be a valid DOS file
specification and just truncates it to "ABASDBAS.BDB".
VFILESPEC Any valid DOS file specification for a file that
already exists. "ABASDBASBDBASBD" will still be
accepted but the resulting "ABASDBAS.BDB" file had
better exist.
MM/DD/YY A valid date.
PATH A valid DOS path. There's no slash at the end of
the path.
VPATH A valid DOS path that already exists. There's no
slash at the end of the path.
The pattern may also consist of any series of the following characters:
A alpha input (A-Z) (either upper or lower case)
B Boolean input (T/F/Y/N; translated to Y/N on output)
N numeric input (digits 0 to 9 only)
U uppercase alpha (A-Z) only (translated to uppercase
if provided in lowercase)
X any character (decimal 32 to 125) (no translation)
! uppercase any character (decimal 32 to 125) (translated
to uppercase if provided in lowercase)
else any other characters in the pattern are left in the
result verbatim; spaces are not allowed
DEMOSYS.REF Last revised 01/15/93 Page 25
Note that the pattern defines the maximum length of the user's input, not the
minimum. A pattern of "AAAAA" may be filled in with "HI" and be accepted.
The prompt is a one-line input. It can include control codes for position,
color, etc. Control codes can also be used to make it print on multiple lines.
Note that the user's input will appear in the same color as the prompt unless
you include a color specification at the end of the prompt.
It's possible to create a prompt that will generate a fatal non-recoverable
error from The DEMO System. Make sure that the prompt and the maximum size of
the input field fit within the screen limits.
If the environmental variable that you're prompting for already has a value,
then that value will show up as the default when the prompt is given. You can
reset this by using the command "ASSIGN ^Evar^".
Examples:
PROMPT ^EX^ MM/DD/YY ^C2What is the date of this report? ^C1
PROMPT ^EY^ NNN-NN-NNNN ^C3Enter your social security number:
PROMPT ^EZ^ B Is this correct? ^C2
*******************
PROMPTA ^Evar^ pattern string
Identical to the PROMPT command except the prompt occurs on the alternate
screen.
DEMOSYS.REF Last revised 01/15/93 Page 26
*******************
QUIT [ return_code ]
The command causes the program to stop and return to DOS. Every control card
file should consist of at least one QUIT statement and, by default, (C-C) is
always defined to do this.
The use of the return code (which can be an environmental variable) allows you
to use The DEMO System in sophisticated ways within a batch file. For example,
let's say you have a menu system set up where some options will jump to DOS and
run a batch command and return to The DEMO System, while other options will not
return. You could set up some options in The DEMO System to set the return code
as 1 (run an application defined in the batch file DOIT.BAT and then come back),
2 (run DOIT.BAT but don't come back), and 3 (normal end; person wanted out of
the system). If The DEMO System blows up (e.g. you request a prompt that can't
possibly fit in the space allocated), The DEMO System itself will return an
errorlevel of 0. Unfortunately, this is how it works in QuickBASIC and I can't
change that. So the complete batch file might look like this:
:Restart
MYDEMO (or whatever you call your demonstration program)
IF ERRORLEVEL 3 GOTO :Goodbye
IF ERRORLEVEL 2 GOTO :NoReturn
IF ERRORLEVEL 1 GOTO :Return
ECHO Fatal error in The DEMO System
ECHO Check your control cards!
GOTO :Done
:Return
CALL DOIT.BAT
GOTO :Restart
:NoReturn
DOIT.BAT (since CALL not used, will execute the batch file
and then stop; no need for a GOTO afterward)
:Goodbye
ECHO All done!
:Done
Having said all this, creating files and then testing for them with an IF EXIST
statement in your DOS batch file is probably easier.
If you loaded any VGA text definitions (using the LOADLOGO command), you may
want to issue a LOADLOGO CLEAR command before quitting.
Upon exit, QUIT leaves the cursor wherever it was last placed. You may want to
issue a LOCATE command (or an ECHO command with ^Prow,col specification) before
exiting. This is typically done by adding a statement like this before QUIT:
ECHO ^P23,1^C1Thank you for your interest in our product!
Note that a QUIT statement on its own (outside a KEY statement) will result in
the current screen being closed and must be followed by a new page declaration
or else the end of the file.
DEMOSYS.REF Last revised 01/15/93 Page 27
*******************
RD directory
Removes a subdirectory. If that directory does not exist or it cannot be
removed, an error message will be displayed but the program will continue on.
The directory can be an environmental variable. It can contain drive
information if desired.
See also the CD, CDD, DRIVE, and MD commands.
*******************
REDRAW
Redraws the current text screen without branching. Redrawing is frequently
necessary if you want to recover from the output of a RUN command. The
branching consideration means that, unlike with SCREEN 0 (another way to
accomplish the screen redrawing desire), control will continue with the
statement after REDRAW, instead of re-starting at the first statement of the
screen.
Note that REDRAW affects only screens with attached text screens. It doesn't do
much good for label pages.
An example:
- *002 Sample
KEY A GOTO *003
KEY (ESC) QUIT
/.
Press A or (ESC)
./
- *003
ECHO Testing and press ENTER
PAUSE
REDRAW /* This redraws the screen text (the two lines
/* in the /. ... ./ section below)
RUN DIR *.EXE /W
ECHO Press ENTER
PAUSE
REDRAW
RUNA DIR *.BAS /W /* Doing output to the alternate page
ECHOA Press ENTER
PAUSEA
ECHO Press ENTER again
PAUSE
/.
This is some additional text that keeps coming
up when REDRAW is used but the other stuff doesn't
./
POP /* Remember, this has to be *after* the /. ... ./
DEMOSYS.REF Last revised 01/15/93 Page 28
*******************
RUN [ string ]
Shells to DOS and executes a command (given by "string") in the primary screen.
If the command is not specified, you will be shelled to DOS and left at the DOS
prompt. Say "EXIT" and press ENTER to return to The DEMO System.
The string can be a regular DOS command, any command that's available in your
path, a command with drive and path information if necessary, or the name of a
batch file. The latter is used if you want to execute multiple commands at
once.
RUN leaves a copy of The DEMO System in memory and requires loading COMMAND.COM.
Together, these take up roughly 100K of RAM space. If the remaining space is
not sufficient to run your application, consider using The DEMO System as part
of a batch file, quiting entirely to DOS, running your application, and then
reloading The DEMO System. Techniques for doing this are discussed in
DEMOSYS.DOC under the "Creating menuing systems" section.
Typically, after running the command, your display screen will be messed up.
You may want to use any command that will redraw the current screen (REDRAW or
CLS) or else branch you to another screen (SCREEN, GOTO, CALL, POP) immediately
after doing a CALL command.
The command string can include environmental variables if desired.
You can also add a ">NUL:" at the end of the command string in order to try to
eliminate the screen output from the RUN command. This doesn't always work.
See also the RUNA command.
DEMOSYS.REF Last revised 01/15/93 Page 29
*******************
RUNA [ string ]
Similar to the RUN command except the commands are executed in the alternate
screen (instead of the primary screen) and the alternate screen is also made the
default screen for viewing the results. This provides a way of running a batch
or DOS command without interfering with existing menus.
Some applications will change the default screen and wipe out your primary
screen anyway. This is typically not the case with any internal DOS commands
but it may be a factor with others. In these cases, you might as well use RUN
instead.
The command string can include environmental variables if desired.
*******************
SAVE filename
Saves the current screen to a file. This is desirable in some cases (maybe the
current screen has an application form and you want the user to be able to print
or save it).
"Filename" can by any file (including drive and path information if desired) or
be any of the following DOS devices:
KYBD:
SCRN:
COM1: to COM4:
LPT1: to LPT2:
CONS:
The filename can be an environmental variable if desired.
DEMOSYS.REF Last revised 01/15/93 Page 30
*******************
SCREEN [ TOP | FIRST | -999 to 999 | BOTTOM | LAST ]
Branches the program to another screen or page using an implied GOTO command.
This is very useful for multi-page screens as it avoids the need to code the
name of the screen:
- EXPLAIN.001 First screen
KEY (PGDN) SCREEN 1
KEY (ESC) QUIT
- (GLOBAL)
KEY (PGDN) SCREEN 1
KEY (PGUP) SCREEN -1
KEY (ESC) QUIT
- EXPLAIN.002 Second screen
- EXPLAIN.003 Third screen
- EXPLAIN.004 Fourth screen
- (GLOBAL)
- EXPLAIN.005 Last screen
KEY (PGUP) SCREEN -1
KEY (ESC) QUIT
You can specify screen locations in relative terms using positive numbers to
move to the next screens in sequence and negative numbers to move to the prior
screen. Note that the program does not distinguish text screens from label
screens when it's doing this movement; if you want to avoid a label, make sure
the label is not in the sequence you want to pass through.
You can also specify SCREEN TOP (or SCREEN FIRST) and SCREEN BOTTOM (or SCREEN
LAST) to take the user to the absolute first screen (*not* the one defined by
SET TOP; use "POP TOP" to do this) or the absolute last screen. If you need to
hard-code the screen name, use GOTO instead.
Unlike the GOTO statement, SCREEN does not allow you to pass parameters
(including KEYn or CLEAR). You will need to use GOTO if you want these things.
Note that a SCREEN statement on its own (outside a KEY statement) will result in
the current screen being closed and must be followed by a new page declaration
or else the end of the file.
DEMOSYS.REF Last revised 01/15/93 Page 31
*******************
WRITE filename string
Writes a line of text to a file. This is very useful for creating batch files
from your program. It's also a good way of writing usage information or
anything else you want. The file is appended to (your text is written to the
end of it). If you want the file emptied before you write to it, use a DELETE
command.
"Filename" can by any file (including drive and path information if desired) or
be any of the following DOS devices:
KYBD:
SCRN:
COM1: to COM4:
LPT1: to LPT2:
CONS:
The filename and the string can be an environmental variable if desired.
DEMOSYS.REF Last revised 01/15/93 Page 32
--------------------------------------------------------------------------------
KEY statement
KEY key[,key]... action_command [ parms ]
where:
"key" can consist of any of the following:
regular keys (BS) (LPAREN)
(special keys) (DEL) (PGDN)
(MOUSER) (DOWN) (PGUP)
(MOUSEL) (END) (RIGHT)
(MOUSEB) (ENTER) (RPAREN)
(ELSE) (EQUAL) (SPACE)
(ANY) (ESC) (TAB)
(A-key) (HOME) (UP)
(C-key) (INS) @key
(S-key) (LEFT) (ALT-n)
(LASTKEY) <-- in BUFFER only
If multiple keys are coded in one KEY statement, the keys must be separated by
only a comma, no spaces.
"action_command" are any of the action commands listed previously.
"parms" are in fact required for some action commands.
Four key assignments are made by default by The DEMO System. If you do not want
these keys assigned as such, you have to specifically reassign the keys or use
the (ANY) key assignment. You cannot use SET KEYS CLEAR or an non-specific
(GLOBAL) definition to clear them.
SET (C-C) QUIT
SET (C-F1) ECHO ^P25,65^EFNAME^@
SET (C-J) RUN
SET (C-R) REDRAW
DEMOSYS.REF Last revised 01/15/93 Page 33
--------------------------------------------------------------------------------
Miscellaneous string concepts
Screens, displayed text (with a few exceptions), and some action commands can
have some special things imbedded in them. Most of them accept environmental
variables (strings which can change in value). A few also accept control codes
(which control cursor positions, coloring, and the rest).
Action command Can accept
ASSIGN Environmental variables
CALL Environmental variables (in the parameter list only)
CD Environmental variables
CDD Environmental variables
COPY Environmental variables
DELETE Environmental variables
ECHO, ECHOA Environmental variables and control statements
GOTO Environmental variables (in the parameter list only)
LOCATE Environmental variables
MD Environmental variables
PROMPT, PROMPTA Environmental variables
Control statements in prompt only
QUIT Environmental variables
RD Environmental variables
RUN, RUNA Environmental variables
SAVE Environmental variables
WRITE Environmental variables
Input screens Environmental variables and control statements
The descriptions which follow are also presented in the DEMOSYS.DOC file.
DEMOSYS.REF Last revised 01/15/93 Page 34
Environmental variables:
Most text strings (including input pages) can contain both real and
pseudo-environmental variables. These can include any variable defined in your
DOS environment (such as PROMPT or PATH). The pseudo-variable can also include
several variables within The DEMO System, passed variables, and user-defined
variables. They also include variables that are defined in PROMPT statements
and some others.
All environmental variables appear as "^Evar^" (without the quotes). The DOS
prompt, for example, is represented as "^EPROMPT^". If this character string
appears as part of an output block (either a screen, or a logo, prompt, or ECHO
result), the variable will be expanded into the proper string.
(Some times, this will present problems. Avoid putting an environmental
variable in a row that will not fit on the screen. Results are uncertain in
these cases.)
The variables predefined by The DEMO System include those listed below. Some of
them may not have an immediately useful value but future changes to The DEMO
System will make them relevant.
^EDATE^ the current system date (in mm/dd/yy format)
^ETIME^ the current system time (in hh:mm:ss format)
^EETIME^ the elapsed time that the user has used this program
(in hh:mm:ss format)
^EFNAME^ the name of the screen input file
^EFDESC^ the description (if any) of the screen input file
^EFPAGE^ the sequential number of the screen input file
^EDIR^ the current default directory for the default drive
(no slash appears at the end of the name)
^EINITDIR^ the initial default directory when the program was
loaded (no slash appears at the end of the name)
^EDISPLAY^ the current display type (COLOR or MONO)
^EDISPLAYN^ the current display type (1=COLOR, 2=MONO)
^EFIELD^ the current field number
^ECOL^ the current screen column number
^EROW^ the current screen row number
In addition, when using CALL and GOTO statements, you can pass one of more
variables. These variables are assigned sequentially to the
pseudo-environmental variables ^E1^ to ^E9^.
Note that you can change regular DOS environmental variables (like PROMPT) but
they are redefined only until your program completes. Once you go back to DOS,
they're reset to whatever they started off to be.
You can usually concatenate environmental variables with other variables and
character strings. For example, the following usually works:
KEY (PGDN) GOTO *006 KEY^EFIELD^
DEMOSYS.REF Last revised 01/15/93 Page 35
^ Control codes:
The screens themselves can include codes which establish colors, input
locations, and other things. There are seven types of control codes that The
DEMO System accepts in text strings (including logos and cursor indicators) but
one of them (the "^Prow,col" indicator) should not be used within a screen.
These codes are as follows:
^Cn /* Set the color to color (or monochrome) set "n"
^K /* Establish this as a keyboard-input field
^Evar^ /* Print an environmental variable here
^Tn /* Print "n" non-destructive spaces here
^Sn /* Print "n" destructive spaces here (used only
/* to reduce the size of your input file; The DEMO
/* System automatically uses space compression when it
/* encounters five or more spaces together)
^Pr,c /* Locate the cursor at row "r" and column "c":
/* this setting is not allowed within text screens
/* themselves and should only be used in SET CURSOR,
/* SET LOGO, ECHO, PROMPT, etc commands
^_ /* Ignored. Typically used only if you want to
/* print out one of the other control key sequences
Any text that is not part of these control codes (including spaces) are treated
as text and is printed as is.
DEMOSYS.REF Last revised 01/15/93 Page 36
--------------------------------------------------------------------------------
Primary vs alternate screen
There are two screens available within The DEMO System. The primary screen is
the one that all text screens are shown on. An alternate screen is available
when you want to have some action go on that doesn't interfere with your
original screens.
Almost all commands work only with primary screen. Those which provide you the
option are as follows:
Command Output goes to
ECHO Primary
ECHOA Alternate
PAUSE Primary
PAUSEA Alternate
RUN Primary
RUNA Alternate
In some cases, the command you run will not reflect your wishes as to which
screen it should use.
--------------------------------------------------------------------------------
System maximums
Most of these maximums can be expanded fairly easily if necessary. If this
becomes a problem, contact Wayne Software at the address specified at the top of
this document.
Maximum number of pages: 1000
Keys defined per screen: 255
Keyboard input fields per screen: 90
Maximum number of lines per screen: 25
Maximum supported number of columns per screen: 80
Maximum number of pages with imbedded text: 999
Color sets: 8 (0 to 7)
CALL return stack: last 20 calls
Maximum number of environmental variables used in program: 20