home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / graphics / demos304.zip / DEMOSYS.DOC < prev    next >
Text File  |  1993-03-13  |  98KB  |  2,147 lines

  1.  DEMOSYS.DOC                   Last revised 03/13/93                     Page 1
  2.  
  3.                                 The DEMO System
  4.  
  5.                                  Wayne Software
  6.                                113 Sheffield St.
  7.                             Silver Spring, MD 20910
  8.  
  9.                           Fax support: (301) 588-8986
  10.  
  11.                     General user documentation and tutorial
  12. --------------------------------------------------------------------------------
  13.  
  14.                                Table of Contents
  15.  
  16. Table of contents ...............................................  1
  17. What is The DEMO System? ........................................  2
  18. Shareware notice ................................................  3
  19. Legal stuff .....................................................  3
  20. Registration form for The DEMO System ...........................  4
  21. The DEMO System documentation ...................................  5
  22. Documentation syntax ............................................  5
  23. The DEMO System programs:
  24.   DEMOMAKE.EXE ..................................................  6
  25.   The DEMO System viewer ........................................  6
  26.   DEMOSAVE.EXE (registered users only) ..........................  6
  27.   DEMOSCRS.EXE ..................................................  6
  28.   DEMOSCRX.EXE ..................................................  6
  29. Input files required to create the self-viewer...................  7
  30. Commenting code .................................................  7
  31. Tutorial:
  32.   Screen pages ..................................................  8
  33.     Program Example 1 ...........................................  9
  34.   Settings (SET) statements ..................................... 11
  35.     List of SET commands ........................................ 11
  36.   The screen display ............................................ 12
  37.     Program Example 2 ........................................... 13
  38.     ^ codes ..................................................... 14
  39.     Program Example 3 ........................................... 14
  40.     Variables and functions ..................................... 15
  41.     Program Example 4 ........................................... 16
  42.   Action commands ............................................... 17
  43.     List of action commands ..................................... 17
  44.     Primary vs alternate screen ................................. 19
  45.   Key definitions ............................................... 20
  46.     Program Example 5 ........................................... 22
  47.  DEMOSYS.DOC                   Last revised 03/13/93                     Page 2
  48.  
  49.   Full-screen activities ........................................ 24
  50.     Program Example 6 ........................................... 25
  51.     How input fields are determined and how to do multi-column
  52.       menus ..................................................... 27
  53.     Program Example 7 ........................................... 28
  54.     Mouse support ............................................... 30
  55.       Program Example 8 ......................................... 31
  56.   Keys defined by default ....................................... 32
  57.   Self-running demos ............................................ 33
  58.   Creating menuing systems ...................................... 34
  59.     Program Example 9 ........................................... 36
  60.   Data-entry forms .............................................. 39
  61.     Program Example 10 .......................................... 40
  62.   Using (GLOBAL) ................................................ 43
  63.   More labor-saving techniques .................................. 44
  64.     (SETn) statements ........................................... 44
  65.     Macros ...................................................... 46
  66.       Program Example 11 ........................................ 47
  67.     Included text ............................................... 48
  68.     &P1 to &P9 .................................................. 48
  69.  
  70.  
  71. --------------------------------------------------------------------------------
  72.  
  73.                             What is The DEMO System?
  74.  
  75. The DEMO System is a multi-purpose utility.  It can be used for lots of things:
  76.  
  77. * The DEMO System can can be used to create demonstration programs for text-only
  78.   products.  It allows you to specify branching to different display screens.
  79.   It allows you to define unique actions based on almost any keyboard entry.
  80.   This is an ideal vehicle for demonstrating bulletin boards and CD-ROM products
  81.   without requiring the user to have any hardware.
  82.  
  83. * The DEMO System can be used to create menu systems.  You can present a menu
  84.   with several dozen options, allowing the user to pick an option or view more
  85.   options.  The user can be prompted for information.
  86.  
  87. * The DEMO System can be used to create help and tutorial systems.  You can
  88.   arrange help information in a tree-like structure and have the user branch
  89.   around as necessary.
  90.  
  91. * The DEMO System can be used as a forms generator, prompting the user for
  92.   information and writing it to, say, an ASCII-delimited file for later
  93.   processing.  It comes with the rudiments of a programming language, including
  94.   IF statements and branching tools.
  95.  
  96. You can get a flavor of the possibilities The DEMO System provides you by
  97. running the DEMODEMO.EXE program.  The control statements for this file are
  98. contained in DEMODEMO.CTL.
  99.  
  100. The DEMO System creates an EXE version of your demonstration.  This EXE version
  101. has imbedded CRC checks that prevent unauthorized tampering.  The EXE version
  102. can be distributed without restriction.  The EXE's are relatively small and can
  103. be placed on bulletin boards and floppy diskettes.
  104.  
  105.  DEMOSYS.DOC                   Last revised 03/13/93                     Page 3
  106.  
  107. --------------------------------------------------------------------------------
  108.  
  109.                                 Shareware notice
  110.  
  111. The DEMO System is a shareware product.  This is a "try it before you buy it"
  112. concept.  If you find The DEMO System useful, you should pay the registration
  113. fee (US $50.00) to "Wayne Software" at the following address:
  114.  
  115.                 Wayne Software
  116.                 113 Sheffield St.
  117.                 Silver Spring, MD 20910
  118.  
  119. Upon registration, you will receive:
  120.  
  121. * Fax support for problems.
  122.  
  123. * A program called DEMOSAVE.EXE which takes EXE files created by the The DEMO
  124.   System and recreates the control card statements.  DEMOSAVE.EXE is not for
  125.   re-distribution and is available only to registered users.
  126.  
  127. * A unique code which can be used during DEMOMAKE operation to turn off the
  128.   Wayne Software copyright notice when the demo is viewed.
  129.  
  130. * A disk copy of the current release of DEMOMAKE.EXE.  You will also receive a
  131.   current copy of all of Wayne Software's other freebie software products.
  132.  
  133. Please print the following form, fill out a copy of it, and send it back to
  134. Wayne Software with payment.
  135.  
  136.  
  137. --------------------------------------------------------------------------------
  138.  
  139.                                   Legal stuff
  140.  
  141. No part of this publication may be reproduced, transmitted, transcribed, stored
  142. in a retrieval system, or translated into any other language or computer
  143. language in whole or in part, in any form or by any means, whether it be
  144. electronic, mechanical, magnetic, optical, manual or otherwise, without prior
  145. written consent of Wayne Software.
  146.  
  147. Wayne Software disclaims all warranties as to this software, whether express or
  148. implied, including without limitation any implied warranties of merchantability,
  149. fitness for a particular purpose, functionality, data integrity or protection.
  150.  
  151. All files in The DEMO System can be freely distributed but they must be
  152. distributed as a package.  The registration-only file DEMOSAVE.EXE and its
  153. companion documentation file DEMOSAVE.DOC can not be distributed.  SYSOP's are
  154. not given permission to put advertising in the archive.
  155.  
  156.  DEMOSYS.DOC                   Last revised 03/13/93                     Page 4
  157.  
  158. --------------------------------------------------------------------------------
  159.  
  160.                      Registration form for The DEMO System
  161.  
  162. Your name:      _____________________________________________________________
  163.  
  164. Your company (optional): ____________________________________________________
  165.  
  166. Mailing address: ____________________________________________________________
  167.  
  168.                  ____________________________________________________________
  169.  
  170. City, State, ZIP: ___________________________________________________________
  171.  
  172.                                        Country if not USA:  _________________
  173.  
  174. Voice phone number: _________________________________________________________
  175.  
  176. Fax phone number:   _________________________________________________________
  177.  
  178. Disk size (check one):   360K 5.25" ____        1.2MB 5.25" ____
  179.                          720K 3.5"  ____        1.44MB 3.5" ____
  180.  
  181. Please register me as a paid user of The DEMO System.  A check or money order
  182. for $50.00 (US) is enclosed.  (Sorry.  No credit card orders at this time.)
  183.  
  184.  
  185.  
  186.  
  187. Mail to:        Wayne Software
  188.                 113 Sheffield St.
  189.                 Silver Spring, MD 20910
  190.  
  191.  
  192. Additional comments?
  193.  
  194.  DEMOSYS.DOC                   Last revised 03/13/93                     Page 5
  195.  
  196. --------------------------------------------------------------------------------
  197.  
  198.                          The DEMO System documentation
  199.  
  200. The DEMO System documentation consists of two manuals:
  201.  
  202. DEMOSYS.DOC:  This manual explains the basics of how to create and compile the
  203.   files used by The DEMO System.  It includes a tutorial with examples.
  204.  
  205. DEMOSYS.REF:  This manual is a reference manual that explains each of the
  206.   commands and how they are used.  It also describes the syntax used by the
  207.   DEMOMAKE.EXE program as well as by the viewer.
  208.  
  209. While programming techies are inclined to skip tutorials, you should at least
  210. look through the sample control files (which are stored in the SAMPLES.ZIP file
  211. in the distribution file).  Unlike other programs, the DEMOMAKE.EXE program
  212. itself is not interactive.  You are expected to understand the program somewhat
  213. before you attempt to use it.
  214.  
  215. In addition, two supplemental quickie documentation files are provided:
  216.  
  217. DEMOSCRS.DOC:  Documents the DEMOSCRS.EXE TSR to do screen captures.
  218.  
  219. DEMOSCRX.DOC:  Documents the DEMOSCRX.EXE program to process screen captures.
  220.  
  221.  
  222. --------------------------------------------------------------------------------
  223.  
  224.                               Documentation Syntax
  225.  
  226. Throughout this documentation, required items are capitalized.  Variables appear
  227. in lowercase letters.  So "MD directory" indicates that you must type exactly
  228. the letters "M" and "D" (in either lowercase or uppercase form) whereas
  229. "directory" is to be filled in with some other word.
  230.  
  231. Options are specified in square brackets.  They can be left out if desired.
  232. "RUN [ string ]" indicates that you can use the RUN command on its own (which
  233. will leave you at the DOS prompt) or you can include a command to be executed
  234. (at which point you'll be returned to the demonstrator).
  235.  
  236. When several options are available for a given command and, if any are used, you
  237. can only pick one, the options appear within one set of brackets and a vertical
  238. bar separates each.  So "CALL screen [ KEYn | parms ]" says you can either use
  239. "CALL screen", "CALL screen KEYn", or "CALL screen parms".
  240.  
  241.  
  242.  DEMOSYS.DOC                   Last revised 03/13/93                     Page 6
  243.  
  244. --------------------------------------------------------------------------------
  245.  
  246.                             The DEMO System programs
  247.  
  248. The DEMO System consists of five distinct programs:
  249.  
  250. - DEMOMAKE.EXE:  This program takes a control card file and (typically)
  251.   stand-alone screen files, verifies and compiles the code, and generates a load
  252.   file.  DEMOMAKE.EXE then appends The DEMO System viewer to this file to make a
  253.   single demonstration file.  DEMOMAKE.EXE need not be distributed with your
  254.   demonstration program; it is needed for creating demonstration programs, not
  255.   for viewing them.
  256.  
  257. - The DEMO System viewer:  This program presents your demonstration presentation
  258.   to the end user.  The viewer is a self-contained program which will be called
  259.   anything you want it to be.  The DEMOMAKE.EXE program creates this viewer file
  260.   for you.
  261.  
  262. - DEMOSAVE.EXE:  This program is distributed only to registered users and can
  263.   *not* be distributed with your demonstration program.  DEMOSAVE.EXE allows you
  264.   to uncompile the demonstration file, allowing you to make changes even if
  265.   you're missing some of the original input screens.  It also provides you a
  266.   complete list of all keys that are valid during any given screen, resolving
  267.   all GLOBAL statements for you.
  268.  
  269. - DEMOSCRS.EXE:  This program is a TSR written using Spectra Publishing's
  270.   PowerBASIC 3.0 compiler.  It saves the current contents of the screen
  271.   including all color designations upon activating of the TSR with the
  272.   Alt-Rightshift key.  The program is documented in the file DEMOSCRS.DOC.
  273.  
  274. - DEMOSCRX.EXE:  This program is used in conjunction with DEMOSCRS.EXE.  It can
  275.   be used to create screen files used by The DEMO System.  It can also be used
  276.   to create ANSI.SYS-compatible files.  The program is documented in the file
  277.   DEMOSCRX.DOC.
  278.  
  279.  DEMOSYS.DOC                   Last revised 03/13/93                     Page 7
  280.  
  281. --------------------------------------------------------------------------------
  282.  
  283.                  Input files required to create the self-viewer
  284.  
  285. At a minimum, The DEMO System requires an input file which contains control card
  286. statements.  Typically, it also requires screen files.  At least initially, the
  287. screen files are stored as separate files external to the control card file.
  288.  
  289. All input files are ASCII text files.  They should not contain any tab, page
  290. eject, or other non-printable characters.
  291.  
  292.  
  293. --------------------------------------------------------------------------------
  294.  
  295.                                 Commenting code
  296.  
  297. (This has its own little section because in most application language manuals,
  298. it's almost impossible to find out how to enter comments.)
  299.  
  300. Comments can be imbedded within control cards in several ways:
  301.  
  302. - You can include blank lines between control cards.
  303.  
  304. - You can begin a line with either ":", ";", or "'".
  305.  
  306. - You can designate a comment within a command line by beginning it with "/*".
  307.  
  308. All comments are ignored by the DEMOMAKE program and do not end up in the
  309. compiled code that is actually processed by The DEMO System viewer.
  310.  
  311. The use of comments is heavily recommended.
  312.  
  313.  DEMOSYS.DOC                   Last revised 03/13/93                     Page 8
  314.  
  315. --------------------------------------------------------------------------------
  316.  
  317.                                     Tutorial
  318.  
  319.  
  320. Screen pages:
  321.  
  322. There are a great many types of commands available in the demonstration program.
  323. There are at least 35 unique commands, 12 settings, and several special
  324. operations.
  325.  
  326. Despite the variety, the standard "unit" of the demonstrator is a screen page.
  327. Each screen page can have unique key-press logic assigned to it (pressing "G"
  328. may take you to another screen on one screen page, or it may take you out of the
  329. demonstrator entirely).  Each screen page can also have other unique settings:
  330. the cursor can change, constant text (if any) can change, the colors can change.
  331. All standard screen pages have text screens attached to them; text which is
  332. displayed (such as a menu) presenting the user with information so they can
  333. select the desired options or else text displayed for informational purposes (as
  334. in a help screen).
  335.  
  336. There are several special screen pages.  These pages do not have any text
  337. screens attached to them.  The special pages are:  labels (subroutines which are
  338. executed at a key press), global definitions (key and other settings which apply
  339. to all screens defined after the global definition), set definitions (key and
  340. other settings which can be defined once and then invoked later in different
  341. screens on an as-desired basis), and "once" definitions (operations which are
  342. done once when the program loads and then are not done again; these might
  343. including loading unique fonts so you can have you logo appear as graphics
  344. characters).
  345.  
  346. Screen pages are identified within your control file as statements that begin
  347. with a dash.  All of the screen page statements have same basic format:
  348.  
  349.         - filename [ description ]            /* Screen text is external
  350.         - *ref [ description ]                /* Screen text is imbedded
  351.         - @label [ description ]              /* Action-only pages
  352.         - (GLOBAL) [ description ]            /* Establish defaults for later
  353.         - (GLOBALNC) [ description ]          /* Establish defaults for later
  354.         - (SETn) [ description ]              /* Provide recallable settings
  355.         - (ONCE) [ description ]              /* Done once only
  356.  
  357. The "description" field is totally optional.  It can be recalled by your program
  358. later if necessary using the function %PageDesc%.  Unlike comments, descriptions
  359. stay with the data and are retrieved if DEMOSAVE is run on the file.
  360.  
  361.  DEMOSYS.DOC                   Last revised 03/13/93                     Page 9
  362.  
  363. Each regular screen page can consist of four classes of commands.  Each of these
  364. classes of commands are optional for any given screen.  Most screens will only
  365. have three of the five classes of commands and some types of screens cannot have
  366. one or more of the types.  Each class is processed in the following order:
  367.  
  368. (1) settings (cursor shapes, colors, etc; these are processed immediately when
  369.     the screen is loaded)
  370.  
  371. (2) the screen display (NOT allowed within labels, Global, Set, and Once-only
  372.     screen pages)
  373.  
  374. (3) any forms generator commands (@ commands)
  375.  
  376. (4) action commands (these commands are processed sequentially after the screen
  377.     is displayed; typically, action commands are only used within label screen
  378.     pages; their use within Global screen pages is strongly discouraged and they
  379.     are ignored within Set screen pages)
  380.  
  381. (5) key definitions (what commands to do when a given key is pressed; these are
  382.     processed only if the user presses the desired key; typically, key
  383.     definitions do not appear within label pages)
  384.  
  385. (6) the screen is exited.
  386.  
  387. Although the classes are in fact processed in the above order, they can
  388. typically appear within the control card file in any order.
  389.  
  390. A screen page is defined as ending when the first of any of the following
  391. conditions are met:
  392.  
  393. - The end of the main control file is reached
  394. - Another screen page control statement is reached.
  395. - A QUIT, GOTO, SCREEN, KEYPRESS, or POP action command is encountered.  These
  396.   commands have to be used to end label pages.  Typically, you would not use
  397.   any of these commands with non-label pages.
  398.  
  399.  
  400. Program Example 1:
  401.  
  402. Let's start with a very simple control file.  You want the program to pop up,
  403. say "Hello world", and then return to DOS.  (For some reason, this is the
  404. standard "first program" example in most programming language books.)  This
  405. example doesn't require a text screen at all (we'll add one later); you just
  406. need the following control card file:
  407.  
  408.         - @HI! A label screen page without much to it
  409.         ECHO Hello world
  410.         QUIT
  411.  
  412. The first statement designates that this is a label screen page.  The "A label
  413. screen page without much to it" is the description for the page.  The
  414. description, again, was totally optional and you could have put anything you
  415. wanted (or nothing) here.
  416.  
  417. DEMOSYS.DOC                   Last revised 03/13/93                     Page 10
  418.  
  419. The next two statements are action commands.  They execute sequentially, without
  420. regard to key presses.  Each statement is explained in the reference section
  421. below but the "ECHO" command displays a character string to the viewer's screen
  422. and "QUIT" gets you out of the program.  Every demonstration program should
  423. have at least one "QUIT" statement in at least one screen page.
  424.  
  425. Save these text lines as an ASCII file called EXAM01.CTL.  Then issue the
  426. following command:
  427.  
  428.         DEMOMAKE EXAM01.CTL
  429.  
  430. When you run the EXAM01 file, you'll see some screen activity and get a final
  431. screen that looks something like this:
  432.  
  433.      DEMOMAKE  (c)Copyright 1993, Wayne Software          Last revised xx/xx/xx
  434.      23:24:56: Begin
  435.  
  436.      23:24:56: Begin Pass 1
  437.      Processing     3 line    3 screen    1 in EXAM01.CTL
  438.      Maximum number of keys per screen (including globals and actions): 6
  439.  
  440.      23:24:57: Begin Pass 2
  441.      Reading screen    1 @HI! A label screen page without much to it
  442.      Processed    Screen lines:     0   Keys (and actions):       6
  443.  
  444.      23:24:57: Creating EXAM01.EXE
  445.  
  446.      23:24:57: Done
  447.  
  448. Not a heck of a lot to it.  When you type the command EXAM01.EXE, you'll get
  449. something like the following:
  450.  
  451.      DEMO      (c)Copyright 1993, Wayne Software         Last revised xx/xx/xx
  452.      -Hello world
  453.  
  454. Well, not very exciting, was it?  You could have added a CLS command to get rid
  455. of the copyright stuff but it basically worked the way you expected it to.
  456.  
  457. Note that all programming examples are contained in the SAMPLES.ZIP file within
  458. the distribution file.
  459.  
  460. DEMOSYS.DOC                   Last revised 03/13/93                     Page 11
  461.  
  462. Settings (SET) statements:
  463.  
  464. Settings (SET) statements are defined once for each screen page.  If they are
  465. not defined by you, The DEMO System assigns certain default values for you.  The
  466. setting statements available to you are as follows:
  467.  
  468.         SET BASE n           /* Sets default color to be used on a given screen
  469.         SET CASE OFF         /* The keypress "g" will be treated as "G"
  470.         SET CASE ON          /* "g" and "G" can each have their own actions
  471.         SET CLS ON           /* Clear the screen before this text page
  472.         SET CLS OFF          /* Do not clear the screen before this text page
  473.         SET COLOR settings   /* Define up to 8 color sets for color monitors
  474.         SET CURSOR string    /* Define a cursor to be used during full-screen
  475.         SET KEYS CLEAR       /* Clear all global key settings
  476.         SET KEYS SETn        /* Bring in key settings from setting "n"
  477.         SET LOGO string      /* Display a logo (text) somewhere on the screen
  478.         SET MONO settings    /* Define up to 8 color sets for monochrome users
  479.         SET MOUSE OFF        /* Turns off the mouse cursor
  480.         SET MOUSE ON         /* Turns on the mouse cursor
  481.         SET SETTINGS CLEAR   /* Clear all global SET settings
  482.         SET SETTINGS SETn    /* Bring in SET settings from setting "n"
  483.         SET TOP screen       /* Define top level that program can POP to
  484.  
  485. Most of these options won't make sense at this point and, frankly, you'll never
  486. use some of them.  Commands which are needed in the examples will be explained
  487. briefly on an as-needed basis.  Each command is fully discussed in the reference
  488. section.
  489.  
  490. For reference, the default values (where applicable) for each of these are as
  491. follows:
  492.  
  493.         SET BASE 0
  494.         SET CASE OFF
  495.         SET CLS ON
  496.         SET COLOR 151 154 152 117 097 153 001 157
  497.         SET CURSOR _
  498.         SET LOGO (none)
  499.         SET MONO  150 070 007 157 150 070 007 157
  500.         SET MOUSE OFF
  501.         SET TOP (system picks first non-label screen for you)
  502.  
  503. DEMOSYS.DOC                   Last revised 03/13/93                     Page 12
  504.  
  505. The screen display:
  506.  
  507. For screen pages that allow a screen display, the screen itself is a block of
  508. text consisting of at most 25 lines, each no more than 80 characters in length.
  509. Initially, you can create the screen pages using any combination of a text
  510. editor, by using a text capture program (such as PC Magazine's PRN2FILE
  511. program), or by using the included DEMOSCRS.EXE and DEMOSCRX.EXE programs.
  512.  
  513. These text pages can be stored as either separate external files (each file
  514. containing just one screen's worth of information) or else they can be imbedded
  515. within the control card file.  The DEMOSAVE program (available only for
  516. registered users) recreates the control cards with all screens being imbedded.
  517.  
  518. The chief advantage of imbedded screen files is one of control; it's
  519. easier to maintain a single combined file than it is to have lots of little
  520. screen files.
  521.  
  522. The disadvantages are several; risks increase with only one file (lose the
  523. control file and you have to recreate everything from scratch or else use
  524. DEMOSAVE), larger files are typically harder to edit and maneuver around, and
  525. the DEMOMAKE.EXE program will actually have to process any imbedded text lines
  526. twice instead of once so compilation is slower.
  527.  
  528. If the screen files are external, the screen page control card follows this
  529. format:
  530.  
  531.         - filename [ description ]            /* Screen text is external
  532.  
  533. The "filename" can include drive and path information if desired.  Otherwise,
  534. the program will look for the file in your default directory unless you've
  535. provided a DATADIR command telling it to look for the files elsewhere.
  536.  
  537. For imbedded screen files, the control card looks like this:
  538.  
  539.         - *ref [ description ]                /* Screen text is imbedded
  540.  
  541. The "ref" is a unique and short (one word) clue for what the screen text does
  542. (you can always add a fuller "description").  The shorter the better as far as
  543. the program is concerned but each reference must be unique.
  544.  
  545. If the screen files are internal, the contents of the screen must be defined
  546. before the next screen control card statement is encountered.  The screen is
  547. defined in a block of text that begins with "/." by itself on one line, followed
  548. by the up-to-25 lines of text, followed by "./" on a line by itself.
  549.  
  550.  
  551. DEMOSYS.DOC                   Last revised 03/13/93                     Page 13
  552.  
  553. Program Example 2:
  554.  
  555. Let's do the "Hello World" example using an imbedded screen file instead of the
  556. ECHO command.  To do this, create the following control file as save it as
  557. EXAM02.CTL:
  558.  
  559.         - *DEMO An imbedded screen file
  560.         /.
  561.         Hello world
  562.         ./
  563.         QUIT
  564.  
  565. Remember the rules for what defines the end of a screen page.  Among other
  566. things, a screen page ends when it hits a QUIT (or POP, GOTO, SCREEN, or
  567. KEYPRESS) action command.  If you had placed the QUIT command before the
  568. imbedded text, the program would have misplaced the imbedded text and would have
  569. given you an error message.
  570.  
  571. Compile this text file ("DEMOMAKE EXAM02.CTL") and then run it ("EXAM02").  The
  572. screen will clear, the words "Hello there!" will appear, and you'll be left at
  573. the DOS prompt.
  574.  
  575.  
  576. DEMOSYS.DOC                   Last revised 03/13/93                     Page 14
  577.  
  578. ^ codes:
  579.  
  580. The screens themselves can include codes which establish colors, input
  581. locations, and other things.  There are seven types of control codes that The
  582. DEMO System accepts in text strings (including logos and cursor indicators) but
  583. one of them (the "^Prow,col" indicator) should not be used within a screen.
  584. These codes are as follows:
  585.  
  586.         ^Cn             /* Set the color to color (or monochrome) set "n"
  587.         ^K              /* Establish this as a keyboard-input field
  588.         ^Evar^          /* Print a DOS environmental variable here
  589.         ^Uvar^          /* Print a user-defined variable here
  590.         ^Tn             /* Print "n" non-destructive spaces here
  591.         ^Sn             /* Print "n" destructive spaces here (used only
  592.                         /* to reduce the size of your input file; The DEMO
  593.                         /* System automatically uses space compression when it
  594.                         /* encounters five or more spaces together)
  595.         ^Pr,c           /* Locate the cursor at row "r" and column "c":
  596.                         /* this setting is not allowed within text screens
  597.                         /* themselves and should only be used in SET CURSOR,
  598.                         /* SET LOGO, ECHO, PROMPT, etc commands
  599.         ^_              /* Ignored.  Typically used only if you want to
  600.                         /* print out one of the other control key sequences
  601.  
  602. Any text that is not part of these control codes (including spaces) are treated
  603. as text and is printed as is.
  604.  
  605.  
  606. Program Example 3:
  607.  
  608. Okay, back to the "Hello world" example.  In this case, we're going to print a
  609. text screen which contains the words "Hello world", then print a "Goodbye world"
  610. string on top of that screen, and then quit.
  611.  
  612. Create the following control cards and save them as EXAM03.CTL:
  613.  
  614.         - *Overprinting Doing a screen, overprinting it, and then quitting
  615.         /.
  616.  
  617.         ^S20^C1Hello ^C0world
  618.         ./
  619.         ECHO ^P20,20^C2Goodbye ^C3world
  620.         QUIT
  621.  
  622. After compiling the program ("DEMOMAKE EXAM03.CTL"), then running it ("EXAM03"),
  623. you'll see the screen clear, print a blank line, skip to column 20, print "Hello
  624. world" in two different colors, then skip 18 lines and print "Goodbye world" in
  625. two different colors underneath it.
  626.  
  627. While these examples work as expected, they don't sound like anything you'd like
  628. to demonstrate, do they?  We're getting there!
  629.  
  630.  
  631. DEMOSYS.DOC                   Last revised 03/13/93                     Page 15
  632.  
  633. Variables and functions:
  634.  
  635. Most text strings (including input pages) can contain DOS-defined environmental
  636. variables (like your system prompt), user-defined variables, and system-defined
  637. functions.  User-defined variables can be displayed or modified; the others
  638. cannot be changed.
  639.  
  640. All DOS-defined environmental variables appear as "^Evar^" (without the quotes).
  641. The DOS prompt, for example, is represented as "^EPROMPT^".  If this character
  642. string appears as part of an output block (either a screen, or a logo, prompt,
  643. or ECHO result), the variable will be expanded into the proper string.
  644.  
  645. (Some times, this will present problems.  Avoid putting any variable or function
  646. in a row that, upon expansion, will not fit on the screen.  Results are
  647. uncertain in these cases.)
  648.  
  649. All user-defined variables are represented as "^Uvar^" (again, without the
  650. quotes).  If you want to create a variable called UserName, that would be
  651. "^UUserName^" in The DEMO System.
  652.  
  653. Functions are indicated as "%func%" (again, forget the quotes) followed,
  654. optionally, by one or more parameters.  The current system date, for example, is
  655. %Date%.
  656.  
  657. All of these variables and functions are resolved when The DEMO System viewer is
  658. executed; not when the demo itself is created.  (%Date% will be the date the
  659. user runs the program, not the date you created it.)
  660.  
  661. In addition, functions %1% to %9% are parameters that you pass into a screen
  662. when using a CALL or GOTO statement.  There are over 50 functions; check the
  663. DEMOSYS.REF manual for complete details about each of them.
  664.  
  665. Variables are resolved when the demonstration itself is run, not when it is
  666. compiled.  For example, the path (if requested) will be the user's path.
  667.  
  668. You can usually concatenate variables with other variables and character
  669. strings.  For example, the following usually works:
  670.  
  671.         KEY (PGDN) GOTO *006 KEY%Field%
  672.  
  673. DEMOSYS.DOC                   Last revised 03/13/93                     Page 16
  674.  
  675. Program Example 4:
  676.  
  677. In this example, we'll generate a output screen that shows you the current
  678. definition of several functions.  Note that some of the functions don't really
  679. have applicable values unless they're used in specific cases.
  680.  
  681. Create the following control cards and save them as EXAM04.CTL:
  682.  
  683.         - @MAIN This is the main screen
  684.         CALL @FILE Apples are good for you!
  685.         QUIT
  686.         - @FILE This is the screen that displays everything
  687.         ECHO  Date           = %Date%
  688.         ECHO  Time           = %Time%
  689.         ECHO  TimeElapsed    = %TimeElapsed%
  690.         ECHO
  691.         ECHO  PageName       = %PageName%
  692.         ECHO  PageDesc       = %PageDesc%
  693.         ECHO  PageNum        = %PageNum%
  694.         ECHO
  695.         ECHO  Dir            = %Dir%
  696.         ECHO  DriveDirOrig   = %DriveDirOrig%
  697.         ECHO
  698.         ECHO  FieldNum       = %FieldNum%
  699.         ECHO  Col            = %Col%
  700.         ECHO  Row            = %Row%
  701.         ECHO
  702.         ECHO  Passed parms: (1)=%1% (2)=%2% (3)=%3%
  703.         ECHO  Passed parms: (4)=%4% (5)=%5% (6)=%6%
  704.         ECHO  Passed parms: (7)=%7% (8)=%8% (9)=%9%
  705.         POP
  706.  
  707. Other than the function variables, there is a new action command included in
  708. this example.  The CALL statement brings in another screen page.  The word after
  709. the "CALL" must correspond to a page defined in a screen page statement.  In
  710. this case, the screen page is a label page with no text screen at all.  All
  711. information is displayed using ECHO commands.  At the bottom of the page is the
  712. command "POP" which returns control to the statement after the call.
  713.  
  714. CALL and GOTO are the primary way used to move from one display screen to
  715. another.
  716.  
  717. CALL (and the related GOTO) command allow you to pass in up to 9 words
  718. (separated by one or more spaces) which become functions %1% to %9%.  You could
  719. pass in file names, control ("^") text codes, or anything else you want.  In
  720. this example, "Apples are good for you!" is passed in.  "Apples" is assigned to
  721. %1%, "are" is assigned to %2%, etc.  Variables %6% to %9% are left as blank.
  722.  
  723. Compile this code ("DEMOMAKE EXAM04.CTL") and then test it out ("EXAM04").  It
  724. will display some information on the screen and then quit.
  725.  
  726. DEMOSYS.DOC                   Last revised 03/13/93                     Page 17
  727.  
  728. Action commands:
  729.  
  730. We've already used four action commands:  CALL, ECHO, POP, and QUIT.  There are
  731. more than 40 action commands available within The DEMO System.  These are listed
  732. below.  Some of them will be used in later examples and all are explained in the
  733. reference section at the end.
  734.  
  735. Note that most action commands actually appear within label pages, not screen
  736. pages.  Most of these action commands can be used in KEY statements (discussed
  737. next) but some (like RUN) will typically require a REDRAW command after
  738. executing; since you cannot assign two functions to a single keystroke, you will
  739. want to move these to label pages anyway.
  740.  
  741. Action commands are ignored within SET pages and are not recommended within
  742. Global pages.  Also note that most of the parameters can be replaced by
  743. variables or functions where desired.
  744.  
  745.         ASSIGN ^Uvar^ [ = string ]      /* Assign a value to a user-defined
  746.                                         /* variable
  747.         BEEP                            /* Beep
  748.         BUFFER [ keys ]                 /* Put input characters into a buffer
  749.                                         /* so self-running demoes can be done
  750.         CALL screen [ KEYn | parms ]    /* Call a label or screen, with the
  751.                                         /* intention of returning to the
  752.                                         /* current location
  753.         CD directory                    /* Change to a given subdirectory
  754.         CDD drive:directory             /* Change to a given drive and subdir
  755.         CLS                             /* Clear the primary screen
  756.         CLSA                            /* Clear the alternate screen
  757.         COPY file1 file2                /* Copy file1 as file2
  758.         DELETE filename                 /* Delete a specified file
  759.         DISPLAY COLOR                   /* Use SET COLOR color settings
  760.         DISPLAY MONO                    /* Use SET MONO color settings
  761.         DISPLAY TOGGLE                  /* Toggles between COLOR and MONO
  762.         DRIVE letter                    /* Set the default drive
  763.         DROP location                   /* Sets a location for a later HOP
  764.         ECHO [ string[@] ]              /* Display a given string
  765.         ECHOA [ string[@] ]             /* Display a given string to the
  766.                                         /* alternate screen
  767.         FIELD [ TOP | FIRST | -999 to 999 | BOTTOM | LAST | @1 to @99 ]
  768.                                         /* Move to a particular input field
  769.         GOTO screen [ KEYn | CLEAR | parms ]
  770.                                         /* Branch to a label or screen,
  771.                                         /* intending to not return to the
  772.                                         /* current screen
  773.         HOP location                    /* Unconditionally branches to a DROP
  774.         IF cond1 rel cond2 THEN HOP location
  775.                                         /* Conditionally branches to a DROP site
  776.         KEYPRESS                        /* Wait for a keypress (automatically
  777.                                         /* done in any screen text screen)
  778. DEMOSYS.DOC                   Last revised 03/13/93                     Page 18
  779.  
  780.         LOADLOGO ^Uvar^ char_count      /* Loads bit-mapped characters to
  781.                                         /* replace a VGA text character
  782.         LOADLOGO CLEAR                  /* Clears bit-mapped text characters
  783.         LOCATE row col                  /* Move to a given row and column on
  784.                                         /* the screen, can also be done with
  785.                                         /* ^Pr,c in display string itself
  786.         MD directory                    /* Make a subdirectory
  787.         MSGBOX type message             /* Displays message at primary screen
  788.         MSGBOXA type message            /* Displays message at alternate screen
  789.         NONE                            /* Don't do anything; only used in
  790.                                         /* KEY assignments
  791.         PAUSE [ seconds ]               /* Wait for seconds to pass or until
  792.                                         /* key is pressed
  793.         PAUSEA [ seconds ]              /* Wait on the alternate screen
  794.         PAUSE BREAK ON                  /* Allow people to escape out of
  795.                                         /* buffered sequences
  796.         PAUSE BREAK OFF                 /* Don't allow people to escape
  797.         PAUSE DEMO seconds              /* Wait specified number of seconds
  798.                                         /* before processing next key in the
  799.                                         /* buffer
  800.         PLAY string                     /* Play a given musical string
  801.         PLAY ON                         /* Activate all PLAY commands
  802.         PLAY OFF                        /* Turn off all PLAY commands
  803.         POP [ TOP | 1 to 20 ] [ KEYn ]  /* Return to some CALL statement
  804.         PROMPT ^Uvar^ pattern [ other parms ]
  805.                                         /* Prompt user for some input
  806.         PROMPTA ^Uvar^ pattern [ other parms ]
  807.                                         /* Prompt user, secondary screen
  808.         QUIT [ return_code ]            /* Return to DOS
  809.         RD directory                    /* Remove a subdirectory
  810.         REDRAW                          /* Redraw the current screen
  811.         RUN [ string ]                  /* Run a DOS command
  812.         RUNA [ string ]                 /* Run a DOS command to the
  813.                                         /* alternative screen
  814.         SAVE filename                   /* Save the current screen
  815.         SCREEN [ TOP | FIRST | -999 to 999 | BOTTOM | LAST | @1 to @999 ]
  816.                                         /* Switch to another screen
  817.         SELECT                          /* Allow the mouse to select options;
  818.                                         /* only used in KEY assignments
  819.         WRITE filename string           /* Write a line to a text file
  820.  
  821. Action commands are executed sequentially after the screen text (if any) is
  822. displayed and before any user keypresses are processed (unless KEYPRESS
  823. appears).  While several of the normal computer programming branching
  824. constructs, like GOTO and CALL statements, are implemented in The DEMO System,
  825. you will typically find they are implemented unusually in The DEMO System and
  826. you will need to develop work-arounds for some of them.
  827.  
  828.  
  829. DEMOSYS.DOC                   Last revised 03/13/93                     Page 19
  830.  
  831. Primary vs alternate screen:
  832.  
  833. There are actually two screens that The DEMO System uses.  The first screen, the
  834. "primary screen", is used automatically for all text screens and by most of the
  835. commands.  The second screen, called the "alternate screen", is typically used
  836. when you want to run a DOS command and not have the output from this command
  837. affect the text screen the user is viewing.  Sometimes, you will want the output
  838. of the command to disappear completely.
  839.  
  840. There are are number of commands that provide the capability of writing to
  841. either of these two screens:
  842.  
  843.                         Primary   Alternate
  844.  
  845.                         CLS       vs CLSA
  846.                         ECHO      vs ECHOA
  847.                         MSGBOX    vs MSGBOXA
  848.                         PAUSE     vs PAUSEA
  849.                         PROMPT    vs PROMPTA
  850.                         RUN       vs RUNA
  851.  
  852. In most cases, stick to the command without the "A" suffix.
  853.  
  854.  
  855. DEMOSYS.DOC                   Last revised 03/13/93                     Page 20
  856.  
  857. Key definitions:
  858.  
  859. Okay.  Time for the meat and potatos command within The DEMO System.  Key
  860. definitions tell the program what it should do if the user presses a given
  861. character.
  862.  
  863. Each key definition statement follows this basic format:
  864.  
  865.         KEY key[,key]... action_command [ options ]
  866.  
  867. where, at least for some of the action commands, the options are, in fact, not
  868. optional.
  869.  
  870. The "key" portion of the statement can be any regular character, like "R"
  871. (without the quotes).  If you want to assign an action to them, there are four
  872. characters that have to be coded specially:
  873.  
  874.         =       code as (EQUAL)
  875.         space   code as (SPACE)
  876.         (       code as (LPAREN)
  877.         ,       code as (COMMA)
  878.  
  879. You can also define just about any other character on the keyboard to do
  880. something.  All of these keys are coded as a word in parentheses.  These include
  881. all of the following keys which should be self-evident:
  882.  
  883.         (DEL)   (ENTER) (INS)   (PGUP)  (UP)
  884.         (DOWN)  (ESC)   (LEFT)  (RIGHT) (F1) to (F12)
  885.         (END)   (HOME)  (PGDN)  (TAB)
  886.  
  887. as well as some keys that may not be readily apparent or be standard:
  888.  
  889.         (BS)            backspace key
  890.         (A-key)         Any letter key or F1 to F12 with Alt key pressed
  891.         (A-n)           Any key sequence generated by pressing the Alt
  892.                         key down, and, while keeping it down, pressing
  893.                         one to three digits on the numeric keypad
  894.         (C-key)         Any letter key, ENTER, BS, or F1 to F12 with Ctrl key
  895.                         pressed
  896.         (S-key)         TAB, DEL, INS, END, DOWN, PGDN, F1 to F12, etc with
  897.                         shift key pressed
  898.  
  899. Note that all one-letter control keys are in fact defined as something else too.
  900. (C-M) internally is the same key as (ENTER), (C-I) is the same as (TAB), etc.
  901. You should watch out for this when you define your key sequences; only the first
  902. key assignment will win.
  903.  
  904. You should also watch for this when you use the (A-n) convention.  Most keys in
  905. the (A-32) to (A-126) range can be entered directly.  Most of the keys before
  906. (A-32) are in fact keys like (ENTER) and (BS).  If you have one key assigned
  907. with something like (A-62) and another key defined as ">" (decimal value 62),
  908. the first key defined will always win.
  909.  
  910. DEMOSYS.DOC                   Last revised 03/13/93                     Page 21
  911.  
  912. You can assign multiple keys to the same action if desired, either on separate
  913. KEY statements or else by separating each key with a comma *only* (don't put any
  914. spaces around the comma).
  915.  
  916. Three mouse-related "keys":
  917.  
  918.         (MOUSER)        right mouse button pressed
  919.         (MOUSEL)        left mouse button pressed
  920.         (MOUSEB)        both left and right mouse buttons pressed
  921.  
  922. Full-screen field related keys:
  923.  
  924.         @1 to @90       field-selections 1 to 90
  925.  
  926. And three special "keys":
  927.  
  928.         (ELSE)          any non-defined key was pressed
  929.         (ANY)           any key was pressed
  930.         (LASTKEY)       the last user key pressed; only allowed in BUFFER cmd
  931.  
  932. The "action_command" and "[ options ]" part of the KEY statement are the same as
  933. were mentioned above.
  934.  
  935. Typically, you will have key presses either call another screen or go to another
  936. screen.  The difference between a CALL and a GOTO is whether you want to be able
  937. to return easily to where you were when you issued the command.  You might use a
  938. CALL statement from a main menu, which offers the user several choices and then
  939. ultimately returns the user to the menu.  You might use a GOTO statement when
  940. you have several pages of information to present to a user and you want PgDn to
  941. simply go to the next screen of information.
  942.  
  943.  
  944. DEMOSYS.DOC                   Last revised 03/13/93                     Page 22
  945.  
  946. Program Example 5:
  947.  
  948. It's time for a more useful example.  In this case, you're going to have a menu
  949. with two branching options as well as a "quit" option.  The program will contain
  950. three screens: a main menu and the two subsequent screens (one of which is a
  951. label screen).  We won't use any full-screen options at this point.
  952.  
  953. Create your control card file EXAM05.CTL:
  954.  
  955.         - *001 Main menu
  956.         KEY A,(MOUSEL) CALL *002
  957.         KEY B,(MOUSER) CALL @003
  958.         KEY Q,(MOUSEB) QUIT
  959.         /.
  960.         Select an option:
  961.  
  962.            A. Display the current date and time             (left mouse button)
  963.            B. Display the files in the default subdirectory (right mouse button)
  964.  
  965.            Q. Quit                                          (both buttons)
  966.         ./
  967.         - *002 Display the current date and time
  968.         KEY (ANY) POP
  969.         /.
  970.         Current date:    %Date%
  971.         Current time:    %Time%
  972.         Elapsed time:    %TimeElapsed%
  973.  
  974.         Press any key to return to the main menu
  975.         ./
  976.         - @003 Display a directory
  977.         RUN DIR /W
  978.         ECHO Press a key to return to the main menu
  979.         PAUSE
  980.         POP
  981.         POP
  982.  
  983. DEMOSYS.DOC                   Last revised 03/13/93                     Page 23
  984.  
  985. This example has three KEY statements appearing in the first screen alone:
  986.  
  987.         KEY A,(MOUSEL) CALL *002
  988.         KEY B,(MOUSER) CALL @003
  989.         KEY Q,(MOUSEB) QUIT
  990.  
  991. When an "A" character or the left mouse button is pressed, the first KEY
  992. statement calls screen "*002", which has some imbedded text.  When a "B"
  993. character or the right mouse button is pressed, the second KEY statement calls
  994. the label "@003", which has some RUN and ECHO commands in it.  "SET CASE OFF" is
  995. the default setting so "a" and "A" are treated the same as are "b" and "B".
  996.  
  997. The third statement quits the program when a "Q" (or "q") or both mouse buttons
  998. are pressed.
  999.  
  1000. Screen *002 contains another KEY statement:  "KEY (ANY) POP".  This says that if
  1001. the user presses any key (including either mouse key), the program will return
  1002. to the previous CALL statement.  In this case, it will return to *001, from
  1003. which the CALL statement was made.
  1004.  
  1005. Several new action commands are used here.  The "RUN DIR /W" command shells out
  1006. to the DOS command processor, and runs a directory command with the "/W" (wide)
  1007. option.  "PAUSE" waits for the user to enter any keystroke and then goes on.
  1008.  
  1009. The %func% items (like %Time%) in *002 are functions which were discussed above.
  1010.  
  1011. Compile this code ("DEMOMAKE EXAM05.CTL") and then test it out ("EXAM05").  The
  1012. screen will clear, you'll get a small menu, you can pick any of the options by
  1013. using the first character.  When you're done, press Q and you'll be returned to
  1014. DOS.
  1015.  
  1016. This is a typical example for a demo set up for a bulletin board.  In BBS's, you
  1017. typically select an item by pressing a mnemonic key.  There is usually no
  1018. ability to do any selections using cursor keys.
  1019.  
  1020. Non-BBS applications, on the other hand, allow users to select options based on
  1021. moving the cursor and pressing Enter.  For this, you need to know some
  1022. full-screen functions.
  1023.  
  1024.  
  1025. DEMOSYS.DOC                   Last revised 03/13/93                     Page 24
  1026.  
  1027. Full-screen activities:
  1028.  
  1029. Full-screen systems typically allow the user to move around the menu using the
  1030. cursor keys.  For example, a list of 10 items might be presented vertically on
  1031. the screen and you're able to use the up and down cursor keys to position the
  1032. cursor to the item you want.  Then you press Enter.
  1033.  
  1034. The DEMO System allows this as well.  There are a number of things that have to
  1035. be decided:
  1036.  
  1037. * What user-selectable fields are there?  What format will they have on the
  1038.   screen?  Are they arranged in columns or vertically?  Or are they some
  1039.   combination of both?
  1040.  
  1041. * What keys can be used to maneuver around the screen and what do they do?  A
  1042.   vertical list might support just the up and down arrow keys.  But typically,
  1043.   you will also want to support the Home and End keys to move to the first and
  1044.   last item on the list.  If you have a menu with vertical lists in several
  1045.   columns, you may want to add support for the right and left arrow keys.
  1046.  
  1047. * What should the cursor look like?  Should it be something like a greater-than
  1048.   symbol (">").  Or should it be a different-colored text block?  Or should it
  1049.   be parentheses around the current item, perhaps also in a different-colored
  1050.   text block?
  1051.  
  1052. * Where do you want the cursor to start in each field?  One space before the
  1053.   item?  Two spaces?  Three?  Maybe the cursor is "==>"; four would be
  1054.   appropriate for that.  Maybe the cursor appears *after* the item?
  1055.  
  1056. In The DEMO System, all input screens are in fact text screens.  If you want to
  1057. designate fields within the screen, you use the "^K" character combination where
  1058. you want the field location to begin.  You can designate up to 90 input areas
  1059. per screen.
  1060.  
  1061. For single-column presentations, you can skip lines all you want.  For
  1062. multi-column presentations, there are some other things to consider.  We'll
  1063. cover the simpler single-column presentation first.
  1064.  
  1065.  
  1066. DEMOSYS.DOC                   Last revised 03/13/93                     Page 25
  1067.  
  1068. Program Example 6:
  1069.  
  1070. In this example, we're going to do a short menu based on the screens in example
  1071. 5.  This menu will allow the user to use the arrow keys to get around.  The
  1072. input selections are arranged in a single column (you can guess what example 7
  1073. will cover!).
  1074.  
  1075. Create your control card file EXAM06.CTL:
  1076.  
  1077.         - *001 Main menu
  1078.         SET CURSOR ^C2=>
  1079.         KEY (UP) FIELD -1
  1080.         KEY (DOWN) FIELD 1
  1081.         KEY A,@1 CALL *002
  1082.         KEY B,@2 CALL @003
  1083.         KEY Q,@3 QUIT
  1084.         /.
  1085.         Select an option:
  1086.  
  1087.               ^K   A. Display the current date and time
  1088.               ^K   B. Display the files in the default subdirectory
  1089.  
  1090.               ^K   Q. Quit
  1091.         ./
  1092.         - *002 Display the current date and time
  1093.         KEY (ANY) POP
  1094.         /.
  1095.         Current date:    %Date%
  1096.         Current time:    %Time%
  1097.         Elapsed time:    %TimeElapsed%
  1098.  
  1099.         Press any key to return to the main menu
  1100.         ./
  1101.         - @003 Display a directory
  1102.         RUN DIR /W
  1103.         ECHO Press a key to return to the main menu
  1104.         PAUSE
  1105.         POP
  1106.  
  1107. The *002 and @003 screens are identical to what they were originally.  What's
  1108. been added are the full-screen commands in the first screen.
  1109.  
  1110. Checking the changes line by line, the first new statement is:
  1111.  
  1112.         SET CURSOR ^C2=>
  1113.  
  1114. This establishes a cursor as "=>" which will be printed using color set 2
  1115. (which defaults to white on green).  The next lines establish what happens when
  1116. the up and down arrow keys are used:
  1117.  
  1118.         KEY (UP) FIELD -1
  1119.         KEY (DOWN) FIELD 1
  1120.  
  1121. DEMOSYS.DOC                   Last revised 03/13/93                     Page 26
  1122.  
  1123. If (UP) is pressed, the cursor will move from the current field to the previous
  1124. field.  If it's at the top item, it will be moved to the bottom item.  If (DOWN)
  1125. is pressed, the cursor will move from the current field to the next field.  If
  1126. it's at the bottom item, it will be moved to the top item.
  1127.  
  1128. These two keys don't actually select any of the items on the list.  They simply
  1129. determined where the cursor would be placed.  If Enter is pressed, the key
  1130. statement designated with that input field's number will take affect:
  1131.  
  1132.         KEY A,@1 CALL *002
  1133.         KEY B,@2 CALL @003
  1134.         KEY Q,@3 QUIT
  1135.  
  1136. If the cursor is at the first field when Enter is pressed, page *002 will be
  1137. executed.  If it's at the second field, then label page @003 will be executed.
  1138. If it's at the third field, the user will drop to DOS.
  1139.  
  1140. The actual designation of what fields are defined in done in the screen portion:
  1141.  
  1142.         /.
  1143.         Select an option:
  1144.  
  1145.               ^K   A. Display the current date and time
  1146.               ^K   B. Display the files of the default subdirectory
  1147.  
  1148.               ^K   Q. Quit
  1149.         ./
  1150.  
  1151. The "^K" combination is used three times so there are three user-selectable
  1152. fields.  Note that there are three spaces between the "^K" and the item letter.
  1153. This means that there will be one space between the cursor (which is two
  1154. characters long) and the item letter.
  1155.  
  1156. Note that the cursor will skip all lines that don't contain a ^K designator.
  1157.  
  1158. Compile this code ("DEMOMAKE EXAM06.CTL") and then test it out ("EXAM06").  The
  1159. screen will clear, you'll get a small menu, and you can pick any of the options
  1160. by using either the first character or by using the cursor keys and then
  1161. pressing Enter.  When you're done, press Q or move the cursor to the Q option
  1162. and press Enter.  You'll then be returned to DOS.
  1163.  
  1164.  
  1165. DEMOSYS.DOC                   Last revised 03/13/93                     Page 27
  1166.  
  1167. How input fields are determined and how to do multi-column menus:
  1168.  
  1169. The DEMO System detects input fields in the order they are found in the screen
  1170. file.  The fields are numbered from the first column to the last column, first
  1171. line to last line.
  1172.  
  1173. The "KEY (DOWN) FIELD 1" statement tells The DEMO System to move the cursor from
  1174. the current field location to the next field location.  If that field location
  1175. is on the next line, the cursor will physically move down.  If, on the other
  1176. hand, that field is on the current line, the cursor will instead move physically
  1177. right instead of down.
  1178.  
  1179. The DEMO System does not try to make the (DOWN) key move to the next line.  As
  1180. far as The DEMO System is concerned, the key sequence for (DOWN) is defined as
  1181. an action command; that action command, not the key itself, are processed during
  1182. a demonstration.
  1183.  
  1184. If you have a multicolumn input screen, you will have to select your key
  1185. locations more carefully.  Typically, you will want to insure that all columns
  1186. have the same number of input fields.  You will want to do this even if there
  1187. are cells that are missing in a given column.  (The reason for this will make
  1188. sense in the example that follows.)
  1189.  
  1190. Keep in mind that any keys that aren't defined for The DEMO System are in fact
  1191. ignored.  If someone positions the cursor at a field for which you don't have
  1192. any KEY statements and presses Enter, nothing happens.
  1193.  
  1194. Let's design a screen with multi-column user inputs.
  1195.  
  1196.  
  1197. DEMOSYS.DOC                   Last revised 03/13/93                     Page 28
  1198.  
  1199. Program Example 7:
  1200.  
  1201. In this example, we're going to do a multi-column menu.  The menu selections
  1202. don't actually do much (we need to keep the example short).  This menu will
  1203. allow the user to use the arrow keys to get around.
  1204.  
  1205. Create your control card file EXAM07.CTL:
  1206.  
  1207.         - *SCR Basic input screen
  1208.         SET CURSOR ^C2(^T8)
  1209.         KEY (RIGHT) FIELD 1
  1210.         KEY (LEFT)  FIELD -1
  1211.         KEY (UP)    FIELD -3
  1212.         KEY (DOWN)  FIELD 3
  1213.         KEY (HOME)  FIELD TOP
  1214.         KEY (END)   FIELD BOTTOM
  1215.         KEY @1      CALL @DISPLAY Field 1
  1216.         KEY @2      CALL @DISPLAY Field 2
  1217.         KEY @3      CALL @DISPLAY Field 3
  1218.         KEY @4      CALL @DISPLAY Field 4
  1219.         KEY @5      CALL @DISPLAY Field 5
  1220.         KEY @6      CALL @DISPLAY Field 6
  1221.         KEY @7      CALL @DISPLAY Field 7
  1222.         KEY @8      CALL @DISPLAY Field 8
  1223.         KEY @10     CALL @DISPLAY Field 10
  1224.         KEY @11     CALL @DISPLAY Field 11
  1225.         KEY @13     CALL @DISPLAY Field 13
  1226.         KEY @14     CALL @DISPLAY Field 14
  1227.         KEY @15     QUIT
  1228.         /.
  1229.            Use the cursor keys to select a cell below:
  1230.  
  1231.            ^K Field 1      ^K Field 2      ^K Field 3
  1232.            ^K Field 4      ^K Field 5      ^K Field 6
  1233.            ^K Field 7      ^K Field 8      ^K
  1234.            ^K Field 10     ^K Field 11     ^K
  1235.            ^K Field 13     ^K Field 14     ^K Quit
  1236.         ./
  1237.         - @DISPLAY
  1238.         ECHO ^P10,10^C2You selected %1% %2%
  1239.         PAUSE 2                 /* Waits for two seconds or a user keystroke
  1240.         POP
  1241.  
  1242. For instructional purposes only, the text screen labels the fields sequentially
  1243. in the order that the program sees them (left to right, top line down).  There's
  1244. no reason you'd have the user see something like "Field 4" when they selected
  1245. something.
  1246.  
  1247. The (RIGHT) and (LEFT) KEY statements do about what you'd expect them to do.
  1248. They move the cursor one field to the left or right ("KEY (RIGHT) FIELD 1" moves
  1249. it one field to the right).  When the cursor is on the last field of a row,
  1250. pressing (RIGHT) will move it to the first field of the next row.  Pressing
  1251. (LEFT) will do the reverse.
  1252.  
  1253. DEMOSYS.DOC                   Last revised 03/13/93                     Page 29
  1254.  
  1255. The (UP) and (DOWN) key statements had to trick the program.  If you want the
  1256. cursor to move down to the cell immediately below the current one, the program
  1257. has to be told to move the cursor over three fields.  If, for example, the
  1258. cursor is on field 1, "SET (DOWN) FIELD 3" tells the program to move to field 1
  1259. --> 2 --> 3 --> 4 and stop there.
  1260.  
  1261. If you want to, test out this example eliminating those "unused" ^K designators.
  1262.  
  1263. When the (ENTER) key is pressed, if there is a key field defined on the screen,
  1264. the program checks to see where the cursor is currently positioned.  It then
  1265. executes any KEY statement found for that particular field position.  These KEY
  1266. statements provide the field position as "KEY @n action_command", where "n" is
  1267. the field number.
  1268.  
  1269. (Any "KEY (ENTER) action_command" statements are ignored if there are fields
  1270. defined on the screen.  You have to use cursor movements if you've defined
  1271. fields.)
  1272.  
  1273. There are two fields, fields 9 and 12, which don't have an text next to them.
  1274. If you look through the key assignments, you'll notice there are no
  1275. corresponding "KEY @9 action_command" or "KEY @12 action_command" statements.
  1276. These are dummy fields.  The cursor will be allowed to rest on these fields but
  1277. if the user presses (ENTER), nothing happens.
  1278.  
  1279. Notice the SET CURSOR assignment too.  This one:
  1280.  
  1281.         SET CURSOR ^C2(^T8)
  1282.  
  1283. sets the cursor to a different color, prints a left parenthesis, skips 8
  1284. characters (not printing over what's already there on the screen), and then
  1285. prints the right parenthesis, still in the different color.  This is fairly
  1286. common in full-screen systems.
  1287.  
  1288. Compile this code ("DEMOMAKE EXAM07.CTL") and then test it out ("EXAM07").  The
  1289. screen will clear, you'll get a small menu, and you can pick any of the options
  1290. by using the cursor keys and then pressing Enter.  When you're done, press Q or
  1291. move the cursor to the Q option and press Enter.  You'll then be returned to
  1292. DOS.
  1293.  
  1294.  
  1295. DEMOSYS.DOC                   Last revised 03/13/93                     Page 30
  1296.  
  1297. Mouse support:
  1298.  
  1299. So far, the mouse hasn't been all that useful in any of these examples.  We've
  1300. used the (MOUSER), (MOUSEL), and (MOUSEB) KEY assignment to do the same thing
  1301. that single keystrokes do.  We haven't actually allowed you to move the mouse
  1302. cursor somewhere and pick something.  The DEMO System provides full support for
  1303. the mouse.
  1304.  
  1305. There are only two commands required to provide mouse support.  The first is:
  1306.  
  1307.         SET MOUSE ON
  1308.  
  1309. This turns the mouse cursor on.  The mouse will only be activated in screens
  1310. where there are least two defined keyboard input fields ("^K" fields).  With the
  1311. mouse on, the user can move the mouse cursor anywhere on the screen.
  1312.  
  1313. Once the mouse is turned on, if a designated mouse button is pressed, The DEMO
  1314. System looks for the last keyboard input field to the left of the mouse cursor
  1315. and selects that one as if the cursor had manually been moved to that field.
  1316. The button designation is done using the SELECT command.
  1317.  
  1318. You can designate any or all mouse buttons to do the selecting.  You can have
  1319. the left button (say) select the item while the right button asks as escape:
  1320.  
  1321.         KEY (MOUSEL) SELECT
  1322.         KEY (MOUSER) POP
  1323.  
  1324.  
  1325. DEMOSYS.DOC                   Last revised 03/13/93                     Page 31
  1326.  
  1327. Program Example 8:
  1328.  
  1329. Adding two statements to example 7 provides mouse support for the mouse.  Here's
  1330. the contents for EXAM08.CTL:
  1331.  
  1332.         - *SCR Basic input screen
  1333.         SET CURSOR ^C2(^T8)
  1334.         SET MOUSE ON                       /* Turns mouse support on
  1335.         KEY (RIGHT) FIELD 1
  1336.         KEY (LEFT)  FIELD -1
  1337.         KEY (UP)    FIELD -3
  1338.         KEY (DOWN)  FIELD 3
  1339.         KEY (HOME)  FIELD TOP
  1340.         KEY (END)   FIELD BOTTOM
  1341.         KEY (MOUSER),(MOUSEL) SELECT       /* Says what mouse does
  1342.         KEY @1      CALL @DISPLAY Field 1
  1343.         KEY @2      CALL @DISPLAY Field 2
  1344.         KEY @3      CALL @DISPLAY Field 3
  1345.         KEY @4      CALL @DISPLAY Field 4
  1346.         KEY @5      CALL @DISPLAY Field 5
  1347.         KEY @6      CALL @DISPLAY Field 6
  1348.         KEY @7      CALL @DISPLAY Field 7
  1349.         KEY @8      CALL @DISPLAY Field 8
  1350.         KEY @10     CALL @DISPLAY Field 10
  1351.         KEY @11     CALL @DISPLAY Field 11
  1352.         KEY @13     CALL @DISPLAY Field 13
  1353.         KEY @14     CALL @DISPLAY Field 14
  1354.         KEY @15     QUIT
  1355.         /.
  1356.            Use the cursor keys to select a cell below:
  1357.  
  1358.            ^K Field 1      ^K Field 2      ^K Field 3
  1359.            ^K Field 4      ^K Field 5      ^K Field 6
  1360.            ^K Field 7      ^K Field 8      ^K
  1361.            ^K Field 10     ^K Field 11     ^K
  1362.            ^K Field 13     ^K Field 14     ^K Quit
  1363.         ./
  1364.         - @DISPLAY
  1365.         ECHO ^P10,10^C2You selected %1% %2%
  1366.         PAUSE 2                 /* Waits for two seconds or a user keystroke
  1367.         POP
  1368.  
  1369. Compile the program and try it out.
  1370.  
  1371. DEMOSYS.DOC                   Last revised 03/13/93                     Page 32
  1372.  
  1373. Keys defined by default:
  1374.  
  1375. The DEMO System pre-defines four key combinations for you.  They are defined for
  1376. debugging and "whoops!" purposes.  These assignments are:
  1377.  
  1378.         SET (C-C) QUIT
  1379.         SET (C-F1) ECHO ^P25,65%PageName%@
  1380.         SET (C-J) RUN
  1381.         SET (C-R) REDRAW
  1382.  
  1383. The first assignment provides a QUIT definition, allowing you to get out of the
  1384. program.  This is often necessary because it frequently turns out that even when
  1385. you remember to code one of more QUIT statements in your program, you code a
  1386. screen that leaves you in any infinite loop.  (The most common way to do this is
  1387. to have a page which calls itself.)
  1388.  
  1389. The second assignment tells you the current screen name.  This is useful when
  1390. you're viewing a demo and you notice that you need to make a change to a
  1391. particular screen.  Maybe you forgot to code a key assignment or the characters
  1392. don't align properly.
  1393.  
  1394. The third assignment allows you to jump to DOS.  You need to say "EXIT" at the
  1395. command line in order to be returned to The DEMO System.  This is useful for
  1396. checking directories, making sure required files are present, etc.
  1397.  
  1398. The fourth assignment redraws the current screen for you.  This is frequently
  1399. useful when you've done something like run a DOS command which has messed up
  1400. your display screen and you need to get the menu back on.  (You can also do this
  1401. with a "SCREEN 0" command although that command behaves somewhat differently.
  1402. See the reference manual.)
  1403.  
  1404. You can reassign these keys if desired by doing specific reassignments (e.g.
  1405. "KEY (C-C) GOTO @HOME" or "KEY (C-F1) (NONE)").  They provide some useful
  1406. functionality though and defining other keys to do the same thing is recommended
  1407. if you need these key sequences for something else.
  1408.  
  1409.  
  1410. DEMOSYS.DOC                   Last revised 03/13/93                     Page 33
  1411.  
  1412. Self-running demos:
  1413.  
  1414. You may find yourself wanting to create some self-running demos, where the
  1415. user's keys are in fact pressed for them.  The user will see the results of
  1416. each key press (e.g. the cursor will move).  This may
  1417. be desirable for an entire presentation or just for parts of a presentation.
  1418.  
  1419. Several action commands relate to this capability:
  1420.  
  1421.         BUFFER [ keys ]
  1422.         KEYPRESS
  1423.         PAUSE BREAK ON
  1424.         PAUSE BREAK OFF
  1425.         PAUSE DEMO seconds
  1426.  
  1427. The BUFFER command pushes keystrokes into a keystroke buffer.  Each keystroke
  1428. is retrieved sequentially on a first-in, first-out basis whenever a KEYPRESS
  1429. command is encountered or whenever the program awaits a keypress in a normal
  1430. text screen.  You can clear the buffer by skipping the "keys" parameter.
  1431.  
  1432. The KEYPRESS command is typically used in a label screen to get a keypress from
  1433. the buffer.  Since label screens never wait for a keypress otherwise (except
  1434. when executing PAUSE or PROMPT commands), this is the only way to have them
  1435. register any user-defined inputs.
  1436.  
  1437. PAUSE BREAK ON says that a user can escape out of buffered keystrokes by
  1438. pressing the Escape key.  Doing so clears the keystroke buffer.  This is useful
  1439. if you want them to be able to do something on their own instead of getting
  1440. stuck with your keystrokes only.  PAUSE BREAK ON is the default in The DEMO
  1441. System.
  1442.  
  1443. PAUSE BREAK OFF is the opposite of PAUSE BREAK ON.  PAUSE BREAK ON is the
  1444. default for The DEMO System.  Note that it's possible to crash The DEMO System
  1445. (as well as your reputation) through poor placement of a BUFFER command.
  1446. Placing a BUFFER command in a screen that is frequently executed may result in
  1447. the BUFFER being filled up and provide no convenient way for the user to get
  1448. out.  If you have PAUSE BREAK OFF in effect, you may provide yourself will no
  1449. way out of an overflowing buffer.  Having said this, PAUSE BREAK OFF is clearly
  1450. necessary in some cases.
  1451.  
  1452. PAUSE DEMO seconds tells The DEMO System to wait a specified number of seconds
  1453. before processing each keystroke.  The user can press a key before the number
  1454. of seconds is up, in which case the next keystroke will be activated (or, if
  1455. PAUSE BREAK ON is in effect and they press Escape, they'll clear the buffer).
  1456. The default value for this is PAUSE DEMO 1.  Other than PAUSE DEMO 0 (which
  1457. operates too quickly to be seen on some systems), PAUSE DEMO 1 is as fast as you
  1458. can go.
  1459.  
  1460. Note that the contents of the buffer is not applied to PROMPT or PAUSE/PAUSEA
  1461. action commands.  The system will not take the buffered input to answer a prompt
  1462. or get out of a wait condition.
  1463.  
  1464. DEMOSYS.DOC                   Last revised 03/13/93                     Page 34
  1465.  
  1466. Creating menuing systems:
  1467.  
  1468. The DEMO System provides enough functionality to create your own menuing system,
  1469. providing menu access to basic DOS commands as well as a program launcher for
  1470. other application products.  You can set up a series of screens which let the
  1471. user select applications to run or execute various DOS functions for them.
  1472.  
  1473. Several action commands provide DOS functionality and closely correspond to the
  1474. standard DOS commands.  These are listed below without explanation.  See the
  1475. reference manual if any of them don't make sense to you.
  1476.  
  1477.         CD directory
  1478.         CDD drive:directory
  1479.         COPY file1 file2
  1480.         DELETE filename
  1481.         DRIVE letter
  1482.         MD directory
  1483.         RD directory
  1484.         RUN [ string ]
  1485.  
  1486. Several action commands are a bit more obscure.  These are listed below and
  1487. described afterward:
  1488.  
  1489.         PROMPT ^Uvar^ "pattern" [ other parms ]
  1490.         PROMPTA ^Uvar^ "pattern" [ other parms ]
  1491.         QUIT [ return_code ]
  1492.         RUNA [ string ]
  1493.         WRITE filename string
  1494.  
  1495. The PROMPT command prompts the user for a response and sets a user variable to
  1496. their response.  The command consists of several parts (which are described
  1497. completely in the reference manual):
  1498.  
  1499. * "^Uvar^" is the user-defined variable that stores the results of the user's
  1500.   input.
  1501.  
  1502. * "pattern" defines the type of input that is expected.  The "pattern" can be
  1503.   replaced by any combination of the following characters:
  1504.  
  1505.         A               alpha input (A-Z) (either upper or lower case)
  1506.         B               Boolean input (T/F/Y/N; translated to Y/N on output)
  1507.         N               numeric input (digits 0 to 9 only)
  1508.         U               uppercase alpha (A-Z) only (translated to uppercase
  1509.                         if provided in lowercase)
  1510.         X               any character (decimal 32 to 125) (no translation)
  1511.         !               uppercase any character (decimal 32 to 125) (translated
  1512.                         to uppercase if provided in lowercase)
  1513.         else            any other characters in the pattern are left in the
  1514.                         result verbatim; spaces are not allowed
  1515.         numchar         a number followed by a one-character pattern is treated
  1516.                         as a repetition factor.  "5X" is the same as "XXXXX"
  1517. DEMOSYS.DOC                   Last revised 03/13/93                     Page 35
  1518.  
  1519. * "LEN=n" specifies the minimum length that the user has to fill in.  Optional.
  1520.  
  1521. * "RANGE=n-n" specifies the range (typically numeric) that the values must fall
  1522.   within.  Optional.
  1523.  
  1524. * "DEF=s" specifies the default value.  Optional.
  1525.  
  1526. * "TEST=cond1 rel cond2" imposes a test that the user entry must meet before the
  1527.   response will be accepted.  For example, you can verify that they entered an
  1528.   existing file name if you wanted to.
  1529.  
  1530. * "QUIT=key" is used for forms entry and specifies which key will exit you from
  1531.   the form.  Defaults to QUIT=(NONE).
  1532.  
  1533. * "VQUIT=key" is used for forms entry and specifies which key will exit you
  1534.   from the form.  Unlike QUIT=key, VQUIT=key checks to make sure that all
  1535.   fields in fact met any imposed conditions.  Defaults to VQUIT=(NONE).
  1536.  
  1537. * "HELP=key" specifies what key will show the required input pattern and other
  1538.   characteristics.  Defaults to HELP=(A-F1).
  1539.  
  1540. * "COLOR=n" specifies the color to use for the input.  Defaults to COLOR=1.
  1541.  
  1542. * "REQ" specifies the the field must be filled in.  Optional.
  1543.  
  1544. * "NOESCAPE" prevents the person from leaving the form.
  1545.  
  1546. * "QUIET" keeps to "Insr"/"Over" insert/overwrite indicator off the screen.
  1547.  
  1548. * "-QUIET" keeps the "Insr"/"Over" indicator on.
  1549.  
  1550. The QUIT command has already been used in a few examples to get out of the
  1551. program.  It also provides the ability to pass a return code to DOS.  Quitting
  1552. and looking for a return code is one way that a menu batch command can run
  1553. another application without running out of memory.  An easier method is to
  1554. create a batch file in the menuing system and test for this batch file on exit.
  1555. The easier method is demonstrated below.
  1556.  
  1557. The RUNA command switches to the alternate screen before running a DOS command.
  1558. You will see the command run but it probably won't permanently affect your menu
  1559. display.  Many applications will take charge of your screens anyway and they'll
  1560. affect the menu.  Note that using RUN or RUNA means The DEMO System remains in
  1561. memory while your command is run.  The DEMO System requires about 130K of RAM.
  1562. If your program needs more than about 475K, you will have to exit the system
  1563. (using QUIT), run a batch file, and then return to The DEMO System.  This is
  1564. demonstrated below.
  1565.  
  1566. The WRITE command writes a line to a text file.  This is typically used for
  1567. creating a batch file from scratch.  It can also be used to create accounting
  1568. records saying that a particular command was run at a particular date and time.
  1569. It can also be used to general ASCII-delimited files.
  1570.  
  1571.  
  1572. DEMOSYS.DOC                   Last revised 03/13/93                     Page 36
  1573.  
  1574. Program Example 9:
  1575.  
  1576. This is going to be a fairly complicated example.  For most real menuing
  1577. systems, you need to set up a batch file that calls The DEMO System and then
  1578. optionally calls another batch file which has commands to execute.  This is done
  1579. for any command that is too big to fit into memory.
  1580.  
  1581. In this example, most of the options in the menu are directly available from The
  1582. MENU System but one, running WordPerfect, is not.  We presume for the sake of
  1583. this example that you have a batch file called WP.BAT that invokes WordPerfect,
  1584. changing the subdirectory and drive if necessary, and running it will all of the
  1585. proper options.  You could have many batch files if you wanted to.  The DEMO
  1586. System also allows you to create files (such as batch files) on the fly using
  1587. the WRITE action command.
  1588.  
  1589. You also have a batch file that you're running The DEMO System from.  We'll call
  1590. it EXAMMENU.BAT and it looks like this:
  1591.  
  1592.         ECHO OFF
  1593.         :Restart
  1594.         EXAM09
  1595.         IF NOT EXIST EXAM09X.BAT GOTO :Done
  1596.         CALL EXAM09X.BAT
  1597.         GOTO :Restart
  1598.         :Done
  1599.  
  1600. This batch file loads The DEMO System's program (EXAM09.EXE in this case).  Once
  1601. the program runs, the batch file checks to see if it has created a file called
  1602. EXAM09X.BAT.  If yes, that batch file is run and then The DEMO System is entered
  1603. again.  If not, then the user is returned to DOS.
  1604.  
  1605. DEMOSYS.DOC                   Last revised 03/13/93                     Page 37
  1606.  
  1607. EXAM09.EXE is the file you're creating with The DEMO System this time.  Its
  1608. source control cards look like this:
  1609.  
  1610.         /* Creating a sample user menu
  1611.         - (ONCE)
  1612.         DELETE EXAM09X.BAT     /* Killing off the temporary batch file
  1613.         - *000 Main menu
  1614.         KEY (UP)       FIELD -1
  1615.         KEY (DOWN)     FIELD 1
  1616.         KEY @1,A       CALL @SHELLRUN WP.BAT
  1617.         KEY @2,B       CALL @RUN CHKDSK
  1618.         KEY @3,C       CALL @RUN DIR /W
  1619.         KEY @4,D       CALL @RUN FORMAT A:
  1620.         KEY @5,E       CALL @SHELL
  1621.         KEY @6,Q,(ESC) GOTO @QUIT     /* EXAM09X.BAT is gone so batch program st
  1622.         SET CURSOR ^C1==>
  1623.         /.
  1624.         Sample menuing system:
  1625.  
  1626.             Pick an option:
  1627.  
  1628.             ^K   A Run WordPerfect
  1629.             ^K   B Run CHKDSK
  1630.             ^K   C Display a directory
  1631.             ^K   D Run FORMAT A:
  1632.             ^K   E Drop into DOS
  1633.  
  1634.             ^K   Q Quit
  1635.         ./
  1636.         - @RUN Running a command while staying in The MENU System
  1637.         CLS       /* Unnecessary, but it looks better
  1638.         RUN %1% %2% %3% %4%
  1639.         ECHO Press a key to continue
  1640.         PAUSE
  1641.         POP
  1642.         - @SHELLRUN Running a batch command.
  1643.         /* Copying the file as EXAM09X.BAT which is tested for in the
  1644.         /* main batch file.
  1645.         COPY %1% EXAM09X.BAT
  1646.         QUIT
  1647.         - @SHELL Leaving the user in DOS itself
  1648.         ECHO ^P20,1Enter EXIT and then (ENTER) to go back into The MENU System
  1649.         RUN
  1650.         POP
  1651.         - @QUIT Quitting
  1652.         ECHO ^P20,1Thanks for your interest!
  1653.         QUIT
  1654.  
  1655. The entire menuing system consists of just five screens in this example, three
  1656. of which are labels and one of which is a (ONCE) declaration.  This leaves just
  1657. one visual screen for the user to see.  You could easily create a multiple-page
  1658. menuing system which allowed the user to branch through a long series of
  1659. commands and such.
  1660.  
  1661. DEMOSYS.DOC                   Last revised 03/13/93                     Page 38
  1662.  
  1663. The very first screen is a (ONCE) statement that deletes the file EXAM09X.BAT.
  1664. A (ONCE) statement contains statements that you only want run when The DEMO
  1665. System first starts up.  EXAM09X.BAT is the file that is tested for in the
  1666. EXAMMENU.BAT file and whose non-existence means that there's nothing more for
  1667. the program to do ("IF NOT EXIST EXAM09X.BAT GOTO :Done").  The only way that
  1668. file is recreated is in label @SHELLRUN; any other way out of the program will
  1669. result in the file not being there so the user will be left in DOS.
  1670.  
  1671. The first KEY assignment gives control to this @SHELLRUN label.  It passes the
  1672. name of the batch file that should be copied over EXAM09X.BAT.  (You could
  1673. create the batch file on the fly with WRITE commands but it's easier to take an
  1674. existing one if you can.) The passed parameter becomes function %1% (subsequent
  1675. ones would have become %2% to %9%).
  1676.  
  1677. The @SHELLRUN label expands %1% into "WP.BAT" and then copies this file over
  1678. EXAM09X.BAT.  It then quits to DOS, at which point the EXAMMENU.BAT file kicks
  1679. in, runs the program, and then puts you back into The MENU System.
  1680.  
  1681. There are several RUN commands in the program but all of the programs they're
  1682. running can be done within about 475K of memory so they do not cause problems.
  1683.  
  1684. Compile the program ("DEMOMAKE EXAM09.CTL").  Then try the command out (the
  1685. EXAMMENU.BAT file is also in the SAMPLES.ZIP file) and see if it works the way
  1686. you expect it to.
  1687.  
  1688. DEMOSYS.DOC                   Last revised 03/13/93                     Page 39
  1689.  
  1690. Data-entry forms:
  1691.  
  1692. The DEMO System provides the ability to create data-entry forms.  Unlike using a
  1693. series of PROMPT or PROMPTA commands, this allows you to have the user tab
  1694. between input fields, modifying any that they want.
  1695.  
  1696. Data-entry forms are somewhat unique in that they are typically incorporated
  1697. with text screens but the normal KEY statements aren't used at all.  For a
  1698. data-entry form, a page is processed in this order:
  1699.  
  1700.         (1) Any SET statements are executed
  1701.         (2) The screen page is displayed
  1702.         (3) The data-entry is done
  1703.         (4) Any commands are executed
  1704.         (5) KEY statements are *not* executed
  1705.         (6) The screen is exited
  1706.  
  1707. Data-entry forms use the "@" command to prompt the user.  The text screen has to
  1708. have several keyboard input fields (^K) defined.  It has to have one "@" command
  1709. associated with each of these fields.
  1710.  
  1711. Each "@" command has the same format as the PROMPT and PROMPTA commands:
  1712.  
  1713. @ ^Uvar^ "pattern" [ LEN=n ] [ RANGE=n-n ] [ DEF=s ]
  1714.   [ TEST=cond [rel cond] ] [ QUIT=key ] [ VQUIT=key ] [ HELP=key ]
  1715.   [ COLOR=n ] [ REQ ] [ NOESCAPE ] [ QUIET | -QUIET ]
  1716.  
  1717. Each of these parameters were touched upon in the PROMPT discussion above and
  1718. they are fully explained in the DEMOSYS.REF document.  Several of the parameters
  1719. have special applicability in a data-entry form:
  1720.  
  1721. * "QUIT=key" specifies the key that will get the user out of the form without
  1722.   forcing every field to be verified.
  1723.  
  1724. * "VQUIT=key" (verify quit) specifies the key that will get the user out of the
  1725.   form but force every field to be verified.
  1726.  
  1727. * "REQ" specifies that the field has to have some value before the user leaves
  1728.   it.
  1729.  
  1730. * "QUIET" specifies that the "Over"/"Insr" indicators are not to be specified on
  1731.   the bottom of the screen.
  1732.  
  1733. DEMOSYS.DOC                   Last revised 03/13/93                     Page 40
  1734.  
  1735. Program Example 10:
  1736.  
  1737. This example demonstrates how the data-entry forms work.  It prompts the user to
  1738. enter some name and address information.  At the end, they can opt to save the
  1739. record, re-edit the record, or abort the record.
  1740.  
  1741.         - *001 Data-entry form
  1742.         @ ^UName^ "!25X" LEN=5
  1743.         @ ^UCompany^ "!25X"
  1744.         @ ^UStreet1^ "!25X" LEN=5
  1745.         @ ^UStreet2^ "!25X"
  1746.         @ ^UCity^ "!19X"
  1747.         @ ^UState^ "!!" LEN=2
  1748.         @ ^UZip^ "NNNNN-NNNN"
  1749.         @ ^UPhone^ "(NNN) NNN-NNNN" LEN=14
  1750.         @ ^USubmit^ "!" VQUIT=S QUIT=Q DEF=E TEST=%Instr%(SQE,^USubmit^) > 0
  1751.         IF %Upper%(^USubmit^) = Q THEN HOP Skip
  1752.         ASSIGN ^UName^ = %Proper%(^UName^)
  1753.         ASSIGN ^UCompany^ = %Proper%(^UCompany^)
  1754.         ASSIGN ^UStreet1^ = %Proper%(^UStreet1^)
  1755.         ASSIGN ^UStreet2^ = %Proper%(^UStreet2^)
  1756.         ASSIGN ^UCity^ = %Proper%(^UCity^)
  1757.         WRITE TEST.PRN "^UName^","^UCompany^","^UStreet1^","^UStreet2^",
  1758.           (continued) "^UCity^, ^UState^ ^UZip^","^UPhone^"
  1759.         ECHO
  1760.         ECHO Entry saved.
  1761.         DROP Skip
  1762.         /.
  1763.                                        Address entry form
  1764.  
  1765.  
  1766.                         User name:    ^K
  1767.                         Company:      ^K
  1768.                         Street:       ^K
  1769.                                       ^K
  1770.                         City, State ZIP: ^K                    , ^K   ^K
  1771.  
  1772.                         Phone:        ^K
  1773.  
  1774.                         Submit?:      ^K   (S=submit & save, Q=quit & nosave, E=
  1775.         ./
  1776.         POP
  1777.  
  1778. The form itself consists of nine keyboard entry (^K) fields.  There are also
  1779. nine "@" commands.  The first ^K field corresponds to the first "@" command, the
  1780. second to the second, etc.
  1781.  
  1782. In the "City, State ZIP" line, you'll notice the ^K fields are spaced on the
  1783. form.  User input is not inserted into the screen; it's typed over whatever's
  1784. there.  As a result, you have to leave enough space for whatever length fields
  1785. you're going to handle.  Also notice there is a comma before the middle
  1786. parameter.  That's the comma that will appear after City.
  1787.  
  1788. DEMOSYS.DOC                   Last revised 03/13/93                     Page 41
  1789.  
  1790. Each @ command has to specify the variable name that will be assigned to any
  1791. data entered as well the input pattern that that data must adhere to.
  1792. Optionally, you can specify a number of other parameters.
  1793.  
  1794. For the first field--user name--the variable is defined as "^UName^".  The
  1795. variable name itself is in mixed-case ("Name" vs "NAME").  If the user
  1796. incorrectly answers this question, the error message will identify the field by
  1797. variable name.  Logically assigned names in mixed case will be more intuitive to
  1798. your user.  (The DEMO System limits the number of uniquely-named user-defined
  1799. variables.  See the discussion of "System Maximums" in the DEMOSYS.REF
  1800. document.)
  1801.  
  1802. The @ command specifies that the pattern for this field is "!25X".  The "!"
  1803. indicates that the first character will be automatically converted to uppercase.
  1804. The "25X" indicates that the remaining 25 characters can be any character and
  1805. will not be converted to uppercase.
  1806.  
  1807. Finally, the "LEN=5" parameter specifies that the user must enter at least five
  1808. characters for the name or the program will beep, identify an error, and
  1809. reprompt them to enter the name again.
  1810.  
  1811. The last field in the form is identified as "^USubmit^":
  1812.  
  1813.         @ ^USubmit^ "!" VQUIT=S QUIT=Q DEF=E TEST=%Instr%(SQE,^USubmit^) > 0
  1814.  
  1815. The user can only enter one character for this field and it will be
  1816. automatically converted to uppercase by the program.
  1817.  
  1818. "VQUIT=S" (verify quit) specifies that if the user enters an "S" (or "s"), the
  1819. program will check each field to make sure it matches all LEN=, RANGE=, TEST=,
  1820. and REQ conditions and then exit out of the form.  This is typically used when
  1821. the user indicates they want to submit the data from the form.
  1822.  
  1823. "QUIT=Q" specifies that if the user enters an "Q" (or "q"), the program will
  1824. exit out of the form.  If the user avoided fields by tabbing or back-tabbing
  1825. around them, these fields will not be verified.  This is typically used when the
  1826. user wants to quit the form without actually saving anything.
  1827.  
  1828. "DEF=E" specifies that the default value for this field is "E".
  1829.  
  1830. "TEST=%Instr%(SQE,^USubmit^) > 0" indicates that the user has to enter either an
  1831. S, Q, or E or their input will not be accepted.  If they enter the S, the VQUIT=
  1832. clause will take control.  Q will cause QUIT= to take affect.  And E will cause
  1833. the system to skip to the next field (in our case, the first field again) so
  1834. they can edit the data.  (In fact, the QUIT= and VQUIT= options take affect
  1835. before the TEST= clause can be applied; the only thing this TEST= clause will
  1836. actually test for is the "E" key.)
  1837.  
  1838. None of the fields are tagged with "NOESCAPE" so the user can get out at any
  1839. time by pressing (C-C) (exit to DOS) or (C-J) (jump to DOS).
  1840.  
  1841. DEMOSYS.DOC                   Last revised 03/13/93                     Page 42
  1842.  
  1843. Once the user leaves the form--with Q or S--the system will then execute the
  1844. action commands within the page.  The first of these is:
  1845.  
  1846.         IF %Upper%(^USubmit^) = Q THEN HOP Skip
  1847.  
  1848. This tests to see if they entered Q or S.  If Q, the program branches to the
  1849. DROP location Skip.  This avoids writing out the data.
  1850.  
  1851. If S was pressed, the program executes a series of ASSIGN commands which convert
  1852. several text fields to "proper name case".  ^UCity^, which might have been
  1853. entered as "SILVER SPRING", gets converted to "Silver Spring".
  1854.  
  1855. Next, the program writes out the various variables to a file TEST.PRN.  The
  1856. WRITE command had to be split onto multiple lines for documentation purposes;
  1857. it's really all on one line:
  1858.  
  1859.         WRITE TEST.PRN "^UName^","^UCompany^","^UStreet1^","^UStreet2^",
  1860.           (continued) "^UCity^, ^UState^ ^UZip^","^UPhone^"
  1861.  
  1862. The data are written out to TEST.PRN in exactly the format shown.  The quotation
  1863. marks and commas are written as given and the resulting record becomes a
  1864. standard ASCII-delimited record.  Each field is automatically trimmed of
  1865. trailing spaces so the only gaps in the record will be between words or where
  1866. you asked them to be placed.  So the record might be written as such:
  1867.  
  1868.         "Bruce Guthrie","Wayne Software","113 Sheffield St.","",
  1869.           (continued) "Silver Spring, MD 20910","(301) 588-8986"
  1870.  
  1871. DEMOSYS.DOC                   Last revised 03/13/93                     Page 43
  1872.  
  1873. Using (GLOBAL):
  1874.  
  1875. It's time to backtrack a bit.  Six screen page statements were introduced back
  1876. at the beginning of this tutorial:
  1877.  
  1878.         - filename [ description ]            /* Screen text is external
  1879.         - *ref [ description ]                /* Screen text is imbedded
  1880.         - @label [ description ]              /* Action-only pages
  1881.         - (GLOBAL) [ description ]            /* Establish defaults for later
  1882.         - (SETn) [ description ]              /* Provide recallable settings
  1883.         - (ONCE) [ description ]              /* Done once only
  1884.  
  1885. So far, we've covered the first three of these without saying much about the
  1886. remaining ones.
  1887.  
  1888. The (GLOBAL) statement is used when you have a lot of similar screens and you
  1889. want to avoid coding the same basic KEY statements or SET statements for each of
  1890. them.
  1891.  
  1892. For example, say you have a series of screens, all of which should have the same
  1893. cursor shape and all of which should uniformly treat (RIGHT), (LEFT), (UP), and
  1894. (DOWN).  You could of course code the same KEY and SET statements in for each of
  1895. these screens.  Alternatively, you could establish a default for KEY and SET
  1896. statements and all screens defined after that default is set will share those
  1897. defaults.
  1898.  
  1899. In our case, you could say:
  1900.  
  1901.         - (GLOBAL) Establishing certain defaults
  1902.         SET MOUSE ON
  1903.         KEY (MOUSER),(MOUSEL) SELECT
  1904.         KEY (RIGHT) FIELD 1
  1905.         KEY (LEFT) FIELD -1
  1906.         KEY (UP) FIELD -3
  1907.         KEY (DOWN) FIELD 3
  1908.         KEY (ESC) POP
  1909.         SET CURSOR ^C2(^T8)
  1910.         - TEST01.SCR First screen
  1911.         - TEST02.SCR Second screen
  1912.         - TEST03.SCR Third screen
  1913.  
  1914. Presuming that the files TEST01.SCR, TEST02.SCR, and TEST03.SCR all share the
  1915. same types of field assignments, this would work fine.
  1916.  
  1917. (GLOBAL) is presumed for any statements that appear in the control file before
  1918. the first real screen is encountered.  You only *need* to use the (GLOBAL) if
  1919. you want to redefine the defaults part-way through a control file.
  1920.  
  1921. Whenever (GLOBAL) is encountered, all previously-defined (GLOBAL) KEY
  1922. assignments are cleared but SET statements are not.
  1923.  
  1924. You cannot put regular action command (like RUN) in a (GLOBAL) section although
  1925. they can be assigned to a keystroke in that section.  Otherwise, you'd end up
  1926. with an action command being performed at the start of every screen.
  1927.  
  1928. DEMOSYS.DOC                   Last revised 03/13/93                     Page 44
  1929.  
  1930. More labor-saving techniques:
  1931.  
  1932. The (GLOBAL) statement (discussed above) is one way to save yourself from
  1933. adding a lot of repeating lines to your control file.  Other labor-saving tools
  1934. exist and this section discusses them.  These include (SETn) statements, Macros,
  1935. and included text.
  1936.  
  1937.  
  1938. (SETn) statements:
  1939.  
  1940. There can only be one set of (GLOBAL) statements defined at a time.  Frequently,
  1941. you will want to have alternative defaults that you bring in.
  1942.  
  1943. For example, let's say you have a presentation which has some screens with
  1944. single input columns, some with double input columns, and some with only
  1945. horizontal selections (e.g. "Pick a drive: A B C D E F G").  You could spend
  1946. your time trying to make sure that all screens with similar characteristics
  1947. follow each other in sequence but that might destroy the "natural order" of your
  1948. control file.
  1949.  
  1950. The first easy way to get around this is to use (SETn) statements.  These are of
  1951. the format:
  1952.  
  1953.         - (SETn) [ description ]              /* Provide recallable settings
  1954.  
  1955. You can define up to ten (SETn) definitions, where "n" is a digit from "0" to
  1956. "9".  In our example, we could define three (SETn) statements:
  1957.  
  1958.         - (SET0) Single-column input
  1959.         KEY (DOWN) FIELD 1
  1960.         KEY (UP) FIELD -1
  1961.         KEY (HOME) TOP     /* Takes you to first field on screen
  1962.         KEY (END) BOTTOM   /* Takes you to last field on screen
  1963.         KEY (ESC) POP
  1964.         - (SET1) Dual-column input
  1965.         KEY (RIGHT) FIELD 1
  1966.         KEY (LEFT) FIELD -1
  1967.         KEY (UP) FIELD -2
  1968.         KEY (DOWN) FIELD 2
  1969.         KEY (HOME) TOP
  1970.         KEY (END) BOTTOM
  1971.         KEY (ESC) POP
  1972.         - (SET2) Horizontal input
  1973.         KEY (LEFT) FIELD -1
  1974.         KEY (RIGHT) FIELD 1
  1975.         KEY (HOME) TOP
  1976.         KEY (END) BOTTOM
  1977.         KEY (ESC) POP
  1978.  
  1979. DEMOSYS.DOC                   Last revised 03/13/93                     Page 45
  1980.  
  1981. Then, in the screens that need these key definitions, you can refer to the
  1982. appropriate (SETn) definition by using the SET KEYS statement:
  1983.  
  1984.         - TEST01.001 First file with single-column input
  1985.         SET KEYS SET0
  1986.         - TEST01.002 Double-column input
  1987.         SET KEYS SET1
  1988.         - TEST01.003 Another single-column input
  1989.         SET KEYS SET0
  1990.  
  1991. The (SETn) section can also include regular SET statements like SET CURSOR, SET
  1992. COLOR, etc.  These definitions will be brought in if you use the "SET SETTINGS
  1993. SETn" statement in your program.
  1994.  
  1995. Action commands are ignored within a (SETn) definition.
  1996.  
  1997. When you use the SET KEYS or SET SETTINGS statements, the (SETn) definitions
  1998. are added to whatever you already have in your current screen's configuration.
  1999. The configuration is not cleared first.  If the (SETn) definition includes a KEY
  2000. assignment that you try to redefine later for this same screen in your control
  2001. card file, the (SETn) definition will win.
  2002.  
  2003. You must define the (SETn) section before you invoke it.  You can re-use the
  2004. (SETn) declaration if you want.
  2005.  
  2006. The SET KEYS and SET SETTINGS statements count as action commands so they cannot
  2007. be used in (GLOBAL) sections.  Macros, on the other hand, can appear anywhere.
  2008.  
  2009.  
  2010. DEMOSYS.DOC                   Last revised 03/13/93                     Page 46
  2011.  
  2012. Macros:
  2013.  
  2014. Macros are groups of code that are brought in whenever needed.  Macros can
  2015. include SET statements, KEY definitions, action commands, (GLOBAL) statements,
  2016. etc.  In fact, a Macro can include any statement except another block of macro
  2017. statements.
  2018.  
  2019. In most cases, you will only find Macros useful for setting up KEY definitions
  2020. that you want to include in (GLOBAL) statements.  You may also find Macros
  2021. useful in labels when several labels include the same block of action commands.
  2022.  
  2023. Macros begin with a MACRO declaration and include every control line from the
  2024. statement after the MACRO declaration to a corresponding MEND statement:
  2025.  
  2026.         MACRO name [ REUSE | SKIP ]
  2027.         ...
  2028.         MEND
  2029.  
  2030. There has to be one and only one MEND statement for every MACRO declaration.
  2031. The Macro name is truncated at eight characters and has to be unique against all
  2032. other Macro names up to those eight characters.  If "REUSE" is specified and the
  2033. macro name is already in use, the new definition will replace it.  If "SKIP" is
  2034. specified and the macro name is already in use, the new definition will be
  2035. ignored.
  2036.  
  2037. The Macro has to be defined before it is invoked.
  2038.  
  2039. In order to invoke a Macro, you must use the following command:
  2040.  
  2041.         DO name [ parms ]
  2042.  
  2043. The "name" corresponds with the Macro name (again, being truncated at eight
  2044. characters).  The optional parameters allow you to pass in up to 9 words.  These
  2045. words will replace special variables &1 to &9 if any of these variables are
  2046. found within the macro or within any code encountered before the next DO
  2047. statement.  This means that the &1 to &9 variables can appear just about
  2048. anywhere but they will only have a value once a DO statement passes them a
  2049. value.  You can assign multiple words by enclosing the words in quotes.  This is
  2050. shown in the example below.
  2051.  
  2052. If desired, you can issue a DO statement against a system-defined fake Macro
  2053. named (DUMMY).  Depending on whether you pass parameters in or not, you can
  2054. either change the definition of &1 to &9 or clear them entirely.
  2055.  
  2056. Just like the MACRO statement itself, the DO statement can appear anywhere in
  2057. your control card file.
  2058.  
  2059.  
  2060. DEMOSYS.DOC                   Last revised 03/13/93                     Page 47
  2061.  
  2062. Program Example 11:
  2063.  
  2064. In this example, we'll define a Macro and use it and the &1 to &9 variables a
  2065. little bit.
  2066.  
  2067. Create the following control cards and save them as EXAM11.CTL:
  2068.  
  2069.         MACRO @TESTING  /* A sample macro
  2070.         ECHO &1 is coming to &2
  2071.         ECHO Get your &3 ready!
  2072.         ECHO
  2073.         PAUSE 2
  2074.         MEND
  2075.         - @001 Invoking the macro
  2076.         DO @TESTING "Santa Claus" town stockings
  2077.         DO @TESTING "Bill Clinton" "Washington DC" hopes
  2078.         DO @TESTING "George Bush" Texas "tax exemptions"
  2079.         ECHO The value of &^_1 is &1
  2080.         DO (DUMMY)
  2081.         ECHO The value of &^_1 is now &1
  2082.         LOCATE 20 1
  2083.         QUIT
  2084.  
  2085. The Macro is invoked three times within one screen, each time passing in three
  2086. different parameters.  Then one of the parameters is tested outside of the
  2087. Macro.  Then DO (DUMMY) is invoked with no parameters, clearing &1 to &9 and one
  2088. of the variables is tested again.
  2089.  
  2090. One trick that you'll notice here is the use of ^_.  This control combination is
  2091. ignored by the system but only after the other parameters have been resolved.
  2092. As a result, "&1" will actually show up when the ECHO command is printed instead
  2093. of "George Bush" (a definite improvement too).
  2094.  
  2095. As always, compile this text file ("DEMOMAKE EXAM11.CTL") and then run the
  2096. program ("EXAM11").  See if it works the way you'd expect.
  2097.  
  2098.  
  2099. DEMOSYS.DOC                   Last revised 03/13/93                     Page 48
  2100.  
  2101. Included text:
  2102.  
  2103. Periodically, you will develop a subset of a demo file that you will want to use
  2104. in several demos.  For example, you might have a group of screens that talk
  2105. about modem problems and you decide to include this in both a technical help
  2106. program as well as in a demonstration of your BBS.
  2107.  
  2108. While you could manually copy the lines to include into your file, it's easier
  2109. to tell your main control file to include at some point the other text.  This is
  2110. done using the + control statement:
  2111.  
  2112.         + filename
  2113.  
  2114. When The DEMO System encounters one of these statements, it will stop processing
  2115. the current file and start processing the new file.  When done with that file,
  2116. it will return to the originating file.
  2117.  
  2118. Included files can have any type of control cards in them (including Macros).
  2119. They can also have included files, nesting being limited roughly by the number
  2120. of remaining file handles your DOS environment has allowed for.
  2121.  
  2122.  
  2123. &P1 to &P9:
  2124.  
  2125. You can pass up to nine additional parameters when using DEMOMAKE to create your
  2126. demonstration.  These parameters are stored as &P1 to &P9 and can be used in
  2127. your control file.  They will be resolved during compilation.
  2128.  
  2129. For example, say you write a demonstration program and are distributing it
  2130. to two different groups.  You decide it would be nice to have the name of the
  2131. group show up.  You don't want to require them to have an environmental variable
  2132. set (which you could trap with something like ^ECOMPANY^).  You also don't want
  2133. to have to modify the source files twice.
  2134.  
  2135. Instead, you can add &P1 to &P9 in your screens or your control file.  You might
  2136. have a line in a text screen which says:
  2137.  
  2138.         Demonstration prepared for &P1 &P2 &P3 &P4
  2139.  
  2140. Say the control file is TEMP.CTL.  When you want to create the demonstration for
  2141. the company "Batwings and Others", you compile the demonstration using "DEMOMAKE
  2142. TEMP.CTL DEMO1.EXE Batwings and Others".  For "Apples and IBMs Unlimited", you
  2143. compile it with "DEMOMAKE TEMP.CTL DEMO2.EXE Apples and IBMS Unlimited".  (Note
  2144. you have to specify the output file and, in this case, you have to name them
  2145. different things.)
  2146.  
  2147.