home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / graphics / demos304.zip / DEMODEMO.CTL < prev    next >
Text File  |  1993-03-13  |  25KB  |  690 lines

  1. ; DEMODEMO.CTL
  2. ; Showing some of the features of The DEMO System
  3. ; If you recompile, you might want to specify /Q since the noise can
  4. ; get pretty annoying.
  5.  
  6. ; You might want to pass in an additional parameter when using
  7. ; DEMOMAKE to make sure there's some value for &P1
  8.  
  9. - (ONCE)
  10. LOADLOGO ^UBatSymbol^ 3
  11. DATA 221,0,24,28,60,62,63,127,127,127,255,255,255,239,206,132,128
  12. DATA 222,66,126,126,126,126,255,255,255,255,255,255,255,255,126,60,24
  13. DATA 224,0,24,56,60,124,252,254,254,254,255,255,255,247,115,33,1
  14. ; NOTE:  In order to prevent deblanking, the first character after ^UWx^ is
  15. ; a space followed by Alt-254, which shows up as a blank.
  16. assign ^UW1^      ▒▒▒▄     ▒▒▒▄                                                    ▒▒▄
  17. assign ^UW2^       ▒▒█     ▒▒█▀                                                    ▒▒█
  18. assign ^UW3^       ▒▒█     ▒▒█   ▒▒▒▒▒▒▄ ▒▒▄     ▒▒▒▒▒▒▄ ▒▒▒▒▒▒▄ ▒▒▒▒▒▒▒▒▄ ▒▒▒▒▒▒▄ ▒▒█
  19. assign ^UW4^       ▒▒█ ▒▒▄ ▒▒█   ▒▒█▀▀▀▀ ▒▒█     ▒▒█▀▀▀▀ ▒▒█▀▒▒█ ▒▒█▒▒█▒▒█ ▒▒█▀▀▀▀ ▒▒█
  20. assign ^UW5^       ▒▒█ ▒▒█ ▒▒█   ▒▒▒▒▄   ▒▒█     ▒▒█     ▒▒█ ▒▒█ ▒▒█▒▒█▒▒█ ▒▒▒▒▄   ▒▒█
  21. assign ^UW6^       ▒▒█ ▒▒█ ▒▒█   ▒▒█▀▀   ▒▒█     ▒▒█     ▒▒█ ▒▒█ ▒▒█ ▀▀▒▒█ ▒▒█▀▀    ▀▀
  22. assign ^UW7^       ▒▒▒▒▒▒▒▒▒▒█   ▒▒▒▒▒▒▄ ▒▒▒▒▒▒▄ ▒▒▒▒▒▒▄ ▒▒▒▒▒▒█ ▒▒█   ▒▒█ ▒▒▒▒▒▒▄ ▒▒▄
  23. assign ^UW8^        ▀▀▀▀▀▀▀▀▀▀    ▀▀▀▀▀▀  ▀▀▀▀▀▀  ▀▀▀▀▀▀  ▀▀▀▀▀▀  ▀▀    ▀▀  ▀▀▀▀▀▀  ▀▀
  24.  
  25. - (SET1) Defaults for full-screen functions
  26. KEY (HOME)         FIELD FIRST
  27. KEY (UP),(LEFT)    FIELD -1
  28. KEY (DOWN),(RIGHT) FIELD +1
  29. KEY (END)          FIELD LAST
  30.  
  31. - *MENUW.001    Welcome
  32. SET BASE 1
  33. locate 18 1
  34. ECHO ^UW1^
  35. ECHO ^UW2^
  36. ECHO ^UW3^
  37. ECHO ^UW4^
  38. ECHO ^UW5^
  39. ECHO ^UW6^
  40. ECHO ^UW7^
  41. ECHO ^UW8^@
  42. PAUSE .2
  43.  
  44. CLS
  45. locate 15 1
  46. ECHO ^UW1^
  47. ECHO ^UW2^
  48. ECHO ^UW3^
  49. ECHO ^UW4^
  50. ECHO ^UW5^
  51. ECHO ^UW6^
  52. ECHO ^UW7^
  53. ECHO ^UW8^
  54. PAUSE .1
  55.  
  56. CLS
  57. locate 12 1
  58. ECHO ^UW1^
  59. ECHO ^UW2^
  60. ECHO ^UW3^
  61. ECHO ^UW4^
  62. ECHO ^UW5^
  63. ECHO ^UW6^
  64. ECHO ^UW7^
  65. ECHO ^UW8^
  66. PAUSE .1
  67.  
  68. CLS
  69. locate 9 1
  70. ECHO ^UW1^
  71. ECHO ^UW2^
  72. ECHO ^UW3^
  73. ECHO ^UW4^
  74. ECHO ^UW5^
  75. ECHO ^UW6^
  76. ECHO ^UW7^
  77. ECHO ^UW8^
  78. PAUSE .1
  79.  
  80. CLS
  81. locate 6 1
  82. ECHO ^UW1^
  83. ECHO ^UW2^
  84. ECHO ^UW3^
  85. ECHO ^UW4^
  86. ECHO ^UW5^
  87. ECHO ^UW6^
  88. ECHO ^UW7^
  89. ECHO ^UW8^
  90. PAUSE .1
  91.  
  92. CLS
  93. locate 3 1
  94. ECHO ^UW1^
  95. ECHO ^UW2^
  96. ECHO ^UW3^
  97. ECHO ^UW4^
  98. ECHO ^UW5^
  99. ECHO ^UW6^
  100. ECHO ^UW7^
  101. ECHO ^UW8^
  102. PAUSE .1
  103.  
  104. CLS
  105. locate 1 1
  106. ECHO ^UW1^
  107. ECHO ^UW2^
  108. ECHO ^UW3^
  109. ECHO ^UW4^
  110. ECHO ^UW5^
  111. ECHO ^UW6^
  112. ECHO ^UW7^
  113. ECHO ^UW8^
  114. PAUSE .2
  115. ; Dummy page just to have something here
  116. /.
  117.  
  118. ./
  119. SCREEN +1
  120.  
  121. - (GLOBAL)
  122. SET LOGO ^P25,50^C2^UBatSymbol^^C4What ^C1is^C4 The DEMO System?
  123. KEY (ESC) POP               /* Pop back to previous screen
  124. KEY (A-C) CALL @COLOR       /* Switch display to color set
  125. KEY (A-M) CALL @MONO        /* Switch display to monochrome set
  126. KEY (MOUSER),(MOUSEL) POP   /* Either mouse button counts as an escape
  127.                             /* unless specified elsewhere
  128.  
  129. - *000 Central menu
  130. SET TOP
  131. SET CURSOR ^C2-->
  132. SET KEYS (SET1)
  133. SET MOUSE ON
  134. KEY (MOUSER),(MOUSEL) SELECT
  135. KEY A,@1        CALL *001                /* Why use it?
  136. KEY B,@2        CALL *002                /* How to create the input screens
  137. KEY C,@3        CALL *003                /* Compilation vs viewing
  138. KEY D,@4        CALL *004                /* Full-screen features
  139. KEY E,@5        CALL *005                /* DOS functions
  140. KEY F,@6        CALL *006                /* Environmental variables
  141. KEY G,@7        CALL *007                /* SET commands
  142. KEY H,@8        CALL *008                /* Reviewing the screen colors
  143. KEY I,@9        CALL *009                /* Other stuff
  144. KEY J,@10       CALL @GRAPHIC            /* Do a GIF
  145. KEY X,@11,(ESC) GOTO @QUIT               /* Quit demo
  146. /.
  147. This subsystem shows the various features of The DEMO System.  See which:
  148.  
  149.              ^K   A. Why would you want to use The DEMO System?
  150.              ^K   B. How to create the input screens
  151.              ^K   C. Compilation vs viewing
  152.              ^K   D. Full-screen features (incl self-running demos)
  153.              ^K   E. DOS functions (including prompting)
  154.              ^K   F. Variables and system-defined functions
  155.              ^K   G. SET commands
  156.              ^K   H. Reviewing the screen colors
  157.              ^K   I. Other stuff
  158.              ^K   J. Try a graphic (TSHOW WAYNESOF.GIF)
  159.  
  160.              ^K   X. Quit demo
  161. ./
  162.  
  163. - *001 Why would you use The DEMO System
  164. KEY X,(ESC) POP KEY1
  165. /.
  166. What sort of things can you do with The DEMO System?  Well, there are ^C2lots^C0 of
  167. things you can do with it!  Some ideas:
  168.  
  169.   ^C1-^C0 Create demonstration programs to show people how a bulletin board,
  170.       data base program, or anything other text-based system works.
  171.       You can even design demonstrations for products on hardware
  172.       that the user may not have (like a CD-ROM) so they can better
  173.       determine whether they need to buy the hardware or not.
  174.   ^C1-^C0 Design tutorials to show people how to do things.  You can define
  175.       any keys to do anything you want so you can simulate most
  176.       applications.
  177.   ^C1-^C0 Create help systems.
  178.   ^C1-^C0 Create menuing systems.  You can duplicate most of the features
  179.       of a product like AUTOMENU.
  180.   ^C1-^C0 Provide interactive access to information screens (like this one).
  181.       For example, if you have to provide a series of text files to someone,
  182.       you can create a menu of options using The DEMO System and bring up the
  183.       appropriate text file based on the user's selection.
  184.   ^C1-^C0 Create data-entry forms.
  185.  
  186.  
  187. Press ^C1X^C0 or ^C1Esc^C0 to return.
  188. ./
  189.  
  190. - *002 How to create the input screens
  191. KEY X,(ESC) POP KEY2
  192. /.
  193.                                 ^C1Creating screens
  194.  
  195. The DEMO System runs off a series of ASCII text screens, initially stored as
  196. separate text files.  These screens can be created using screen-capture
  197. facilities or be typed in (like these were).  Once created, you can imbed colors
  198. (up to 8 color combinations per screen) and define keyboard entry zones.
  199.  
  200. The individual screens are referenced in a control file which tells the program
  201. what screens to bring in and which keys cause the system to go to other screens
  202. or do other operations.  For example,
  203.  
  204.                 ; Sample control file
  205.                 - PAGE.001 First screen (has options A to C, then X to quit)
  206.                 KEY A GOTO PAGE.002
  207.                 KEY B GOTO PAGE.003
  208.                 KEY C GOTO PAGE.004
  209.                 KEY X QUIT
  210.                 - PAGE.002 Option A
  211.                 ...
  212.  
  213. The screens are brought in, checked, and combined at compilation time (see this
  214. option).
  215.  
  216. Press ^C1X^C0 or ^C1Esc^C0 to go back.
  217. ./
  218.  
  219. - *003 Compilation vs viewing
  220. KEY X,(ESC) POP KEY3
  221. /.
  222.                            ^C1Compilation vs Viewing
  223.  
  224. The DEMO System consists of two programs.
  225.  
  226. The ^C2compiler^C0 (DEMOMAKE) reviews your control card file for syntax errors.
  227. It tokenizes what it can.  It then reads all of your text screens and searches
  228. for control codes in that file.  At the end of this process, the program takes
  229. all of your files including the control card file and creates a single data file
  230. which is then concatenated to the end of the actual The DEMO System viewer.
  231.  
  232. The combined ^C2viewer^C0/data program is what you give your customers.  They
  233. can't tamper with the screens at all.
  234.  
  235. The shareware fee is required for the use of the compiler, not the viewer.  As a
  236. result, you can distribute the results of your compilations to anyone without
  237. charge.
  238.  
  239. Press ^C1X^C0 or ^C1Esc^C0 to go back.
  240. ./
  241.  
  242. - *004 Full-screen features
  243. SET CURSOR ^C2(^T10)
  244. SET MOUSE ON
  245. KEY (MOUSER),(MOUSEL) SELECT
  246. KEY (HOME)  FIELD FIRST
  247. KEY (UP)    FIELD -3
  248. KEY (DOWN)  FIELD +3
  249. KEY (LEFT)  FIELD -1
  250. KEY (RIGHT) FIELD +1
  251. KEY (END)   FIELD LAST
  252. KEY A,@1    CALL @SELECT A
  253. KEY F,@2    CALL *004A
  254. KEY K,@3    CALL @SELECT K
  255. KEY B,@4    CALL @SELECT B
  256. KEY G,@5    CALL @SELECT G
  257. KEY L,@6    CALL @SELECT L
  258. KEY C,@7    CALL @SELECT C
  259. KEY H,@8    CALL @SELECT H
  260. KEY M,@9    CALL @SELF_RUN
  261. KEY D,@10   CALL @SELECT D
  262. KEY I,@11   CALL @SELECT I
  263. KEY E,@13   CALL @SELECT E
  264. KEY J,@14   CALL @SELECT J
  265. KEY X,@15   POP KEY4
  266. KEY (ESC)   NONE
  267. /.
  268. This is an example of what you can do with The DEMO System's full-screen
  269. selections.  You can have the program branch according to the choices selected.
  270. Select an option using either cursor keys or the letter of the option.  Option F
  271. demonstrates how a data entry form might look.  Option M is an example of a
  272. self-running demo which demos a system where you'd want to press a series of
  273. keystrokes for them.
  274.  
  275.         ^K  Option A       ^K  Data Form        ^K  Option K
  276.         ^K  Option B       ^K  Option G         ^K  Option L
  277.         ^K  Option C       ^K  Option H         ^K  SelfRunM
  278.         ^K  Option D       ^K  Option I         ^K
  279.         ^K  Option E       ^K  Option J         ^K  E^C1X^C0it
  280.  
  281.  
  282.  
  283.    ^C2                                                                 ^C2
  284.    ^C2 Notice that the Esc key doesn't work in this screen.  You can   ^C2
  285.    ^C2 enable or disable any keys as desired.                          ^C2
  286.    ^C2                                                                 ^C2
  287. ./
  288.  
  289. - *004A Data-entry form
  290. ; Note that the first character of each field is automatically converted
  291. ; to uppercase for them.  As it is, the %Proper% function fixes up most
  292. ; fields before writing out the record.
  293. @ ^UName^ "!25X" LEN=5
  294. @ ^UCompany^ "!25X"
  295. @ ^UStreet1^ "!25X" LEN=5
  296. @ ^UStreet2^ "!25X"
  297. @ ^UCity^ "!19X"
  298. @ ^UState^ "!!" LEN=2
  299. @ ^UZip^ "NNNNN-NNNN" /* Because of pattern, ZIP will be minimum of 6 chars
  300.                       /* Could have imposed a TEST clause if you wanted.
  301. @ ^UPhone^ "(NNN) NNN-NNNN" LEN=14
  302. @ ^USubmit^ "!" QUIT=S DEF=E TEST=%Instr%(^USubmit^,SE) <> 0
  303. ASSIGN ^UName^ = %Proper%(^UName^)
  304. ASSIGN ^UCompany^ = %Proper%(^UCompany^)
  305. ASSIGN ^UStreet1^ = %Proper%(^UStreet1^)
  306. ASSIGN ^UStreet2^ = %Proper%(^UStreet2^)
  307. ASSIGN ^UCity^ = %Proper%(^UCity^)
  308. ; Note that the trailing blanks are always removed from responses in data-
  309. ; entry forms so you can do something like "^UCity^, ^UState^ ^UZip^" and it
  310. ; will show up correctly as "Silver Spring, MD 20910".
  311. WRITE TEST.PRN "^UName^","^UCompany^","^UStreet1^","^UStreet2^","^UCity^, ^UState^ ^UZip^","^UPhone^"
  312. /.
  313.                                Address entry form
  314.  
  315.     ^C2                                                                       ^C0
  316.     ^C2  This example prompts you to enter someone's name, address, and phone ^C0
  317.     ^C2  information.  Use Tab and shift-Tab to shift between fields.  Use    ^C0
  318.     ^C2  Alt-F1 to see the required patterns.  When you opt to Submit the     ^C0
  319.     ^C2  entry, the form entries will be saved in an ASCII-delimited format   ^C0
  320.     ^C2  under the file name TEST.PRN.                                        ^C0
  321.     ^C2                                                                       ^C0
  322.     ^C2  Note that the user name and the first line of the street address     ^C0
  323.     ^C2  have to be at least 5 characters in length, and the State and phone  ^C0
  324.     ^C2  number have to be completely filled out.  This is user defined.      ^C0
  325.     ^C2                                                                       ^C0
  326.  
  327.                 User name:    ^K
  328.                 Company:      ^K
  329.                 Street:       ^K
  330.                               ^K
  331.                 City, State ZIP: ^K                    , ^K   ^K
  332.  
  333.                 Phone:        ^K
  334.  
  335.                 Submit?:      ^K   (S=submit, E=continue editing)
  336. ./
  337. POP
  338.  
  339. - *005 DOS functions
  340. SET KEYS   (SET1)
  341. SET SETTINGS (SET1)
  342. SET CURSOR ^C3(^T1)
  343. SET MOUSE ON
  344. KEY (MOUSER),(MOUSEL) SELECT
  345. KEY 1,@1        CALL @DOS %Dir%
  346. KEY 2,@2        CALL @WRITE
  347. KEY 3,@3        CALL @PLAY
  348. KEY 4,@4        CALL @PROMPT
  349. KEY 5,@5        CALL @SAVE
  350. KEY L,@6        CALL *005A
  351. KEY X,@7,(ESC)  POP KEY5
  352. /.
  353. The DEMO System provides direct access to all sorts of DOS functions within your
  354. control card files.  You can use RUN commands to get anything not supported.
  355. Some examples are provided below:
  356.  
  357.   ^K^C11^C0. (DOS) You can do any (small) DOS function you need to do or go to the
  358.      DOS shell itself.  Bigger functions can be done with batch files that
  359.      notice whether The DEMO System has created a given batch file to be run.
  360.   ^K^C12^C0. (WRITE) and (DELETE) You can write lines to a text file (e.g. a batch
  361.      file) if you want to.
  362.   ^K^C13^C0. (PLAY) You can add PLAY commands to your files.  This can simulate
  363.      modem dialing or be used to alert people to errors or whatever.
  364.   ^K^C14^C0. (PROMPT) You can prompt a user for information.
  365.   ^K^C15^C0. (SAVE) You can save the screen to a file.
  366.  
  367.   ^K^C1L^C0. List all available DOS and other action commands.
  368.  
  369.   ^K^C1X^C0. Return to previous menu
  370.  
  371. ./
  372.  
  373. - *005A List of DOS and other action commands.
  374. KEY X,(ESC) POP KEY6
  375. /.
  376. The following lists most of the action commands that are in The DEMO System.
  377. (The list excludes several "alternate screen" commands.) Remember that anything
  378. that's not here can be done using the RUN option.
  379.  
  380.   ASSIGN var = value                     MD directory
  381.   BEEP                                   MSGBOX type message
  382.   BUFFER chars                           PAUSE [ seconds ]
  383.   CALL screen [ KEYn | parms ]           PAUSE BREAK { ON | OFF }
  384.   CD directory                           PAUSE DEMO seconds
  385.   CDD drive:\directory                   PLAY string
  386.   CLS                                    PLAY { ON | OFF }
  387.   COPY file1 file2                       POP [ TOP | 1 to 20 | KEYn ]
  388.   DELETE file                            PROMPT var "pattern" misc_parms
  389.   DISPLAY { MONO | COLOR | TOGGLE }      QUIT [ return_code ]
  390.   DRIVE letter                           RD directory
  391.   DROP location                          REDRAW
  392.   ECHO [ string[@] ]                     RUN [ string ]
  393.   FIELD change                           SAVE filename
  394.   GOTO screen [ KEYn | CLEAR | parms ]   SCREEN change [ parms ]
  395.   HOP location                           SELECT
  396.   KEYPRESS                               WRITE filename string
  397.   LOADLOGO ...                           @ var "pattern" misc_parms
  398.   LOCATE row col
  399.  
  400. Press ^C1X^C0 or ^C1Esc^C0 to go back.
  401. ./
  402.  
  403. - *006 Environmental variables
  404. KEY X,(ESC) POP KEY6
  405. KEY F GOTO *006A
  406. /.
  407.                                   ^C1Variables
  408.  
  409. The DEMO System recognizes four different types of variables:
  410.  
  411. ^C1DOS-defined environmental variables^C0:  These are set within the DOS
  412. environment.  These settings can be read (but not reset) by The DEMO System.
  413. For example, your DOS prompt is:  ^C1^EPROMPT^
  414.  
  415. ^C1User-defined variables^C0:  These are variables that are established by you,
  416. the user.  The values of these variables can be set (by the ASSIGN command), or
  417. displayed in ECHO statements or in screens.  These also include variables that
  418. are passed when you call one screen from another screen.
  419.  
  420. ^C1Macro variables^C0:  These are variables that are passed into macros.
  421.  
  422. ^C1Compiler variables^C0:  These are variables passed in on the DEMOMAKE
  423. command line.  These variables can invoke macros or whatever at compilation
  424. time.
  425.  
  426. In addition, The DEMO System provides an extensive list of ^C1functions^C0 that you
  427. can use in your programs.
  428.  
  429. Press ^C1F^C0 to see a list of functions, or ^C1Q^C0 or ^C1Esc^C0 to go back.
  430. ./
  431.  
  432. - *006A Functions
  433. KEY X,(ESC) POP KEY6
  434. /.
  435.                           ^C1System-defined Functions
  436.  
  437. The DEMO System provides a wealth of functions approaching the depth of many
  438. computer language products.  While we don't have room to describe all of the
  439. functions available (see the reference manuals), you can use all of the
  440. following in your programs:
  441.  
  442. %^_Add%(n,n)      %^_DriveDirOrig%      %^_Instr%(s,s)        %^_PathExist%(s)
  443. %^_Col%           %^_DriveDirSlash%(c)  %^_Instr2%(n,s,s)     %^_PrinterReady%(n)
  444. %^_Date%          %^_DriveLabel%(c)     %^_Left%(s,n)         %^_ReplaceStr%(s,s,s)
  445. %^_DateOrig%      %^_DriveOrig%         %^_Len%(s)            %^_Right%(s,n)
  446. %^_DateR2S%(n)    %^_DriveSpace%(c)     %^_Lower%(s)          %^_Row%
  447. %^_DateS2R%(s)    %^_FieldMax%          %^_Mid%(s,n,n)        %^_Sub%(n,n)
  448. %^_DateValid%(s)  %^_FieldNum%          %^_Mouse%             %^_Time%
  449. %^_Dir%           %^_FileMakeTest%(s)   %^_Mult%(n,n)         %^_TimeElapsed%
  450. %^_Display%       %^_FileDate%(s)       %^_PageDesc%          %^_TimeOrig%
  451. %^_DisplayEGA%    %^_FileExist%(s)      %^_PageLines%         %^_TimeR2S%(n)
  452. %^_DisplayNum%    %^_FileOrig%          %^_PageMax%           %^_TimeS2R%(s)
  453. %^_DisplayVGA%    %^_FileOrigDir%       %^_PageName%          %^_Trim%(s)
  454. %^_Div%(n,n)      %^_FileSize%(s)       %^_PageNum%           %^_Upper%(s)
  455. %^_Drive%(c)      %^_FileTime%(s)       %^_PathCanMake%(s)    %^_Weekday%(s)
  456. %^_DriveCur%      %^_FileValid%(s)
  457. %^_DriveDir%(c)   %^_FreeEMS%
  458.  
  459. Press ^C1X^C0 or ^C1Esc^C0 to go back.
  460. ./
  461.  
  462. - *007 SET commands
  463. KEY X,(ESC) POP KEY7
  464. /.
  465.                                   ^C1SET commands
  466.  
  467. The DEMO System provides the ability to set certain conditions and defaults at
  468. compilation time.  These can be set for single screens, a series of screens, or
  469. all screens.  They include:
  470.  
  471.   SET BASE n              Sets the default color parameter for the screen
  472.   SET CASE { ON | OFF }   Whether input case matters
  473.   SET CLS { ON | OFF }    Whether to clear the screen before display
  474.   SET COLOR settings      What colors to use if a color monitor is detected
  475.   SET CURSOR string       What cursor to use for each prompt
  476.   SET KEYS CLEAR          Clears previously defined key assignments
  477.   SET KEYS SETn           Sets screen's keys to match some template
  478.   SET LOGO string         Any text you want displayed on every screen?
  479.   SET MONO settings       What colors to use if a monochrome monitor is
  480.                             used (or simply to provide an alternative color set)
  481.   SET MOUSE { ON | OFF }  Activates mouse support.  Useful for full-screen apps.
  482.   SET SETTINGS CLEAR      Reinitializes screen's default settings
  483.   SET SETTINGS SETn       Sets screen's other settings to match some template
  484.   SET TOP screen          Determine the maximum screen that a use can pop
  485.                             back to
  486.  
  487. Press ^C1X^C0 or ^C1Esc^C0 to go back.
  488. ./
  489.  
  490. - *008 Reviewing the screen colors
  491. KEY X,(ESC) POP KEY8
  492. /.
  493.                           Reviewing the screen colors
  494.  
  495. The following color sets are set by default in The DEMO System.  You can switch
  496. between the color and monochrome settings by using Alt-C (color) and Alt-M
  497. (monochrome).
  498.  
  499.         ^C0 This is color set 0
  500.         ^C1 This is color set 1
  501.         ^C2 This is color set 2
  502.         ^C3 This is color set 3
  503.         ^C4 This is color set 4
  504.         ^C5 This is color set 5
  505.         ^C6 This is color set 6
  506.         ^C7 This is color set 7
  507.  
  508.  
  509. Press ^C1X^C0 or ^C1Esc^C0 to go back.
  510. ./
  511.  
  512. - *009 Other stuff
  513. SET CLS OFF
  514. KEY (ESC),(ELSE)  POP KEY9
  515. /.
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.   ^C2 ╔══════════════════════════════════════════════════════════════════════╗ ^C0
  534.   ^C2 ║ Another screen.  Notice it didn't clear the old one first?           ║ ^C0
  535.   ^C2 ╟──────────────────────────────────────────────────────────────────────╢ ^C0
  536.   ^C2 ║ Just wanted to show you that!  Press a key please.                   ║ ^C0
  537.   ^C2 ╚══════════════════════════════════════════════════════════════════════╝ ^C0
  538. ./
  539.  
  540. /* ---------------------------- labels ----------------------------------------
  541.  
  542. - @COLOR Switching display to color set
  543. DISPLAY COLOR
  544. POP
  545.  
  546. - @DOS Demonstrating some DOS functions
  547. LOCATE 15 1
  548. ECHOA We're about to hop into DOS and do a DIR command.
  549. ECHOA Note that we could have cleared the screen this time but we didn't.
  550. ECHOA Also note that it's going to a different screen.  Ready?
  551. RUNA DIR *.EXE /W
  552. ECHOA Press a key please
  553. PAUSEA
  554. ECHO ^P20,1We're back!  Now we hop into DOS itself.  Say ^C1EXIT^C0 to return.
  555. RUN
  556. ECHO We're about to copy your AUTOEXEC.BAT file as KILLME.NOW
  557. ECHO Note that you can have the cursor stay in place@
  558. RUN COPY C:\AUTOEXEC.BAT C:\KILLME.NOW
  559. ECHO We're back!  Press a key when ready to continue.
  560. PAUSE
  561. ECHO Let's try some of the directory commands.  Creating directory #T#
  562. MD %DriveDirOrig%\#T#
  563. CD %DriveDirOrig%\#T#
  564. ECHO Now running DIR.  Note your subdirectory name:
  565. RUN DIR
  566. ECHO Now resetting the directory back to %DriveDirOrig%
  567. CD %DriveDirOrig%
  568. RD %DriveDirOrig%\#T#
  569. ECHO Just removed #T#.  Press a key
  570. PAUSE
  571. POP
  572.  
  573. - @GRAPHIC Loading a graphic file
  574. /* Note that none of The DEMO System options while you're
  575. /* in another program.
  576. RUN TSHOW WAYNESOF.GIF  /* TSHOW is one of those freebie GIF viewers
  577. /* Have to reload the symbol because the program probably screwed it
  578. /* up.
  579. LOADLOGO CLEAR
  580. LOADLOGO ^UBatSymbol^ 3
  581. DATA 221,0,24,28,60,62,63,127,127,127,255,255,255,239,206,132,128
  582. DATA 222,66,126,126,126,126,255,255,255,255,255,255,255,255,126,60,24
  583. DATA 224,0,24,56,60,124,252,254,254,254,255,255,255,247,115,33,1
  584. POP
  585.  
  586. - @MONO Switching display to Monochrome
  587. DISPLAY MONO
  588. POP
  589.  
  590. - @PLAY Seeing how the PLAY commands work
  591. CLS
  592. ECHO Let's try some play command stuff.  Testing...
  593. PLAY mb t180 o2 p2 p8 l8 ggg l2 e- p24 p8 l8 fff l2 d
  594. ECHO That should still be playing.  Press a key when ready.
  595. PAUSE
  596. POP
  597.  
  598. - @PROMPT Testing the various PROMPT options
  599. /* Prompting the user for input.
  600. CLS
  601. ECHO Okay.  Let's prompt for something.
  602. ECHO The pattern here is "NNNUU" -- three digits, and two letters
  603. ECHO ^C2Enter your user ID? @
  604. PROMPT ^UUserID^ "NNNUU" LEN=5
  605. ECHO ^C0
  606. ECHO      The result is ^UUserID^
  607. ECHO The next one uses the pattern "XXX-UUU-BBB" -- B must be Y/N/T/F
  608. ECHO ^C2Enter another one? @
  609. PROMPT ^UAnother^ "XXX-UUU-BBB"
  610. ECHO ^C0
  611. ECHO      The result was ^UAnother^
  612. ECHO The next one uses the pattern "NN/NN/NN" and must be a date field
  613. ECHO ^C2Enter a date? @
  614. PROMPT ^UDate^ "NN/NN/NN" TEST=%DateValid%(^UDate^) = 1
  615. ECHO ^C0
  616. ECHO       The result was ^UDate^
  617. ECHO The next one requires a valid filespec (existing or not)
  618. ECHO ^C2Enter a filespec? @
  619. PROMPT ^UFileSpec^ "50!" TEST=%FileValid%(^UFileSpec^) <> (NULL)
  620. ECHO ^C0
  621. ECHO       The result was ^UFileSpec^
  622. ECHO The next one requires an existing filespec
  623. ECHO ^C2Enter an existing filename? @
  624. PROMPT ^UX^ "50!" TEST=%FileExist%(^UX^) = 1
  625. ECHO ^C0
  626. ECHO       The result was ^UX^
  627. ECHO The next one requires a valid drive and tells you the default path on it
  628. ECHO ^C2Enter a drive? @
  629. PROMPT ^UX^ "!" TEST=%Drive%(^UX^) = 1 DEF=C
  630. ECHO ^C0
  631. ECHO       The result was ^UX^ and default path there is %DriveDir%(^UX^)
  632. ECHO Press a key please
  633. PAUSE
  634. POP
  635.  
  636. - @QUIT Quitting
  637. LOADLOGO CLEAR
  638. ECHO ^C0
  639. CLS
  640. ECHO Thanks for your interest in The DEMO System
  641. QUIT 5         /* Setting the return code to 5
  642.  
  643. - @SAVE Saving the current screen some place
  644. ECHO ^P20,1You can use device names instead of file names if you want.
  645. ECHO ^C2Save screen under what DOS file name? @
  646. PROMPT ^UName^ "50!" TEST=%FileValid%(^UName^) <> (NULL)
  647. SAVE ^UNAME^
  648. POP
  649.  
  650. - @SELECT Common subroutine showing what option you picked
  651. ECHO ^P20,1You selected the %1% option at %Time%.  Press a key now.
  652. PAUSE
  653. POP
  654.  
  655. - @SELF_RUN  Self-running demo example
  656. ECHO ^P24,1Showing a self-running demo@
  657. PAUSE 1
  658. PAUSE DEMO 0.4
  659. PAUSE BREAK OFF
  660. BUFFER (HOME)
  661. BUFFER (RIGHT)(RIGHT)(RIGHT)(RIGHT)
  662. ECHO ^P25,1Hopping around still...@
  663. BUFFER (UP)(LEFT)(LEFT)(ENTER)
  664. PLAY mb t180 o2 p2 p8 l8 ggg l2 e- p24 p8 l8 fff l2 d
  665. PAUSE BREAK ON
  666. ECHO ^P24,1Feel free to press Esc to stop this@
  667. BUFFER (UP)(UP)(UP)(UP)(UP)(UP)(UP)(UP)(UP)(UP)(UP)
  668. REDRAW
  669. POP
  670.  
  671. - @WRITE Showing how the write functions work
  672. CLS
  673. ECHO We're writing something to a file called C:\KILLME.NOW
  674. ECHO It includes environmental variables for Time, Date, and your system PROMPT
  675. DELETE C:\KILLME.NOW
  676. WRITE C:\KILLME.NOW This is the first line
  677. WRITE C:\KILLME.NOW And the second
  678. WRITE C:\KILLME.NOW Current date:          %Date%
  679. WRITE C:\KILLME.NOW Current time:          %Time%
  680. WRITE C:\KILLME.NOW Elapsed time:          %TimeElapsed%
  681. WRITE C:\KILLME.NOW Directory on C:        %DriveDir%(c)
  682. WRITE C:\KILLME.NOW C:\AUTOEXEC.BAT found: %FileExist%(C:\AUTOEXEC.BAT)
  683. WRITE C:\KILLME.NOW Your system PROMPT: ^EPROMPT^
  684. ECHO Now let's see what the file looks like.
  685. RUN TYPE C:\KILLME.NOW
  686. ECHO Press a key when ready.
  687. PAUSE
  688. POP
  689.  
  690.