home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / progbas / qb4tb520.arj / DEMON.BAS next >
Encoding:
BASIC Source File  |  1991-08-24  |  83.2 KB  |  2,098 lines

  1. ' DEMON.BAS     this program illustrates some of the ways that the routines
  2. '               provided in the Libraries in this package, can enhance your
  3. '               Extended QuickBASIC programs.
  4. '
  5. '   Author:     Christy Gemmell
  6. '   For:        Assembly-Language Toolbox for QuickBASIC
  7. '   Version:    5.20
  8. '   Date:       25/5/1991
  9. '
  10. '   For MicroSoft QuickBASIC and BASIC 7 Professional Development System.
  11. '   Assembler routines created with MicroSoft Macro Assembler MASM 6.0
  12. '
  13. '   Compile:    BC /E/Fs/O/S/X demon;
  14. '   Link:       Link /E/F demon,,,toolbox.lib mixed.lib;
  15. '
  16. '   $DYNAMIC                             ' required for stringsort routine
  17. '
  18. '┌────────────────────────────────────────────────────────────────────────┐
  19. '│      External Functions and Procedures.                                │
  20. '└────────────────────────────────────────────────────────────────────────┘
  21. '
  22. '   The following prototypes refer to assembly-language procedures which
  23. '   are in the library files MIXED.LIB and MIXED.QLB. One or other of these
  24. '   libraries must be linked to the program which calls them.
  25. '
  26.     DECLARE FUNCTION Attribute% (BYVAL Fore%, BYVAL Back%)
  27.     DECLARE FUNCTION CapsLock% (BYVAL Switch%)
  28.     DECLARE FUNCTION Cpu% ()
  29.     DECLARE FUNCTION EmsError% ()
  30.     DECLARE FUNCTION EmsFrame% ()
  31.     DECLARE FUNCTION EmsOwned% (BYVAL Handle%)
  32.     DECLARE FUNCTION EmsPages% (BYVAL Switch%)
  33.     DECLARE FUNCTION EmsPresent% ()
  34.     DECLARE FUNCTION EmsVersion% ()
  35.     DECLARE FUNCTION FarPeek% (BYVAL Segment&, BYVAL OffSet&)
  36.     DECLARE FUNCTION FreeSpace& (BYVAL DriveNo%)
  37.     DECLARE FUNCTION KeyFlags% ()
  38.     DECLARE FUNCTION KeyIn% ()
  39.     DECLARE FUNCTION MathsChip% ()
  40.     DECLARE FUNCTION MouseInit% ()
  41.     DECLARE FUNCTION NumLock% (BYVAL Switch%)
  42.     DECLARE FUNCTION PeekWord& (BYVAL Segment&, BYVAL OffSet&)
  43.     DECLARE FUNCTION PrinTest% (BYVAL Printer%)
  44.     DECLARE FUNCTION Rand% (BYVAL Lower%, BYVAL Higher%)
  45.     DECLARE FUNCTION ScrLock% (BYVAL Switch%)
  46.     DECLARE FUNCTION SizeOf& (FileSpec$)
  47.     DECLARE FUNCTION StatusLine% (Message$)
  48.     DECLARE FUNCTION StringScan% (Trgt$, BYVAL Size%, BYVAL Strt%, BYVAL Addr%)
  49.     DECLARE FUNCTION Verify% (BYVAL Default%, BYVAL Row%, Prompt$,_
  50.                               BYVAL Attr%, BYVAL Mouse%)
  51.     DECLARE SUB BackFill (BYVAL Row%, BYVAL Col%, BYVAL Rows%, BYVAL Cols%,_
  52.                           BYVAL Attr%)
  53.     DECLARE SUB Cipher (Text$, KeyWord$)
  54.     DECLARE SUB ClearEnd (BYVAL Switch%, BYVAL Attr%)
  55.     DECLARE SUB Curtains (BYVAL Speed%, BYVAL Attr%)
  56.     DECLARE SUB EmsGet (BYVAL Segment%, BYVAL OffSet%, BYVAL Length%,_
  57.                         BYVAL Page%, BYVAL Handle%, Done%)
  58.     DECLARE SUB EmsPut (BYVAL Segment%, BYVAL OffSet%, BYVAL Length%,_
  59.                         BYVAL Page%, BYVAL Handle%, Done%)
  60.     DECLARE SUB EmsRelease (BYVAL Handle%)
  61.     DECLARE SUB EmsRequest (BYVAL Pages%, Handle%)
  62.     DECLARE SUB FastPrint (BYVAL Row%, BYVAL Col%, Message$, BYVAL Attr%)
  63.     DECLARE SUB GraPrint (BYVAL xLoc%, BYVAL yLoc%, Text$, BYVAL Attr%,_
  64.                           BYVAL Scale%)
  65.     DECLARE SUB KeyFlush ()
  66.     DECLARE SUB MisTake (BYVAL Row%, Message$, BYVAL Attr%, BYVAL Mouse%)
  67.     DECLARE SUB MouseHide ()
  68.     DECLARE SUB MouseNow (leftButton%, rightButton%, xMouse%, yMouse%)
  69.     DECLARE SUB MouseShow ()
  70.     DECLARE SUB Pause (BYVAL Ticks%)
  71.     DECLARE SUB PopUp (BYVAL Row%, BYVAL Col%, BYVAL Hght%, BYVAL Wdth%,_
  72.                        BYVAL Attr%, BYVAL Brdr%, BYVAL Shdw%, BYVAL Zoom%)
  73.     DECLARE SUB PrintSet (BYVAL Row%, BYVAL Col%, BYVAL Attr%,_
  74.                           BYVAL Printer%, BYVAL Mouse%)
  75.     DECLARE SUB ReSeed (BYVAL Seed&)
  76.     DECLARE SUB Scroll (BYVAL Dir%, BYVAL Y1%, BYVAL X1%, BYVAL Y2%,_
  77.                         BYVAL X2%, BYVAL Units%, BYVAL Attr%)
  78.     DECLARE SUB ShutUp (BYVAL Speed%)
  79.     DECLARE SUB StringSort (BYVAL Dir%, BYVAL Size%, BYVAL Addr%)
  80.     DECLARE SUB VGALoad (File$)
  81.     DECLARE SUB VGAPan (BYVAL X%, BYVAL Y%)
  82.     DECLARE SUB VGASave (File$)
  83.  
  84. '   These are native QuickBASIC procedures which are also in MIXED.LIB/QLB
  85. '
  86.     DECLARE FUNCTION BinDec& (Binary$)
  87.     DECLARE FUNCTION BitTest% (Number%, Bit%)
  88.     DECLARE FUNCTION DateInput$ (Default$, Context%, Topic$, HotKey%)
  89.     DECLARE FUNCTION DosVersion$ ()
  90.     DECLARE FUNCTION FindFile$ (FileSpec$, Attr%, Mouse%)
  91.     DECLARE FUNCTION GetFlag% (Flag%)
  92.     DECLARE FUNCTION GrAttrib% (ForeGround%, BackGround%)
  93.     DECLARE FUNCTION IsDir% (Test$)
  94.     DECLARE FUNCTION LongDate$ (Day%, Month%, Year%)
  95.     DECLARE FUNCTION RevInput$ (Max%, Default$, Legal$, Ctx%, Topic$,_
  96.                                 Mask%, HotKey%)
  97.     DECLARE SUB BarMenu (P1%, P2%, P3%, Menu$(), P5%, P6%, P7%, P8$, Mouse%)
  98.     DECLARE SUB CheckPrinter (Printer%)
  99.     DECLARE SUB Panel (Row%, Col%, Rows%, Cols%, Border%, Attr%)
  100.     DECLARE SUB SetFlag (Flag%, Setting%)
  101.     DECLARE SUB SortFile (PathName$, OffSet%, FieldLen%, RecordLen%, Done%)
  102.     DECLARE SUB VerMenu (P1%, P2%, P3%, P4%, P5%, P6$, Menu$(),_
  103.                          P8%, P9%, P10%, P11%, P12$, Mouse%)
  104.     DECLARE SUB VideoMode (Colour%, MaxRes%, VideoRam%)
  105.  
  106. '   Local, program-specific, functions and procedures.
  107. '
  108.     DECLARE SUB Frame (Title$, Switch%)
  109.  
  110. '┌────────────────────────────────────────────────────────────────────────┐
  111. '│      Initialisation.                                                   │
  112. '└────────────────────────────────────────────────────────────────────────┘
  113. '
  114.     CONST FALSE = 0, TRUE = NOT FALSE
  115.  
  116. '   Allow plenty of stack space for function and procedure calls.
  117. '
  118.     CLEAR , , &H2000
  119.  
  120. '   Establish error trapping and point to error handler.
  121. '
  122.     ON ERROR GOTO Trap
  123.  
  124. '   Check video capabilities of the host system (default to MDA).
  125. '
  126.     Colour% = FALSE                             ' Default to monochrome
  127.     MaxRes% = 0                                 ' Default to text only
  128.     VideoRam% = 4                               ' Default to 4K buffer
  129.  
  130.     VideoMode Colour%, MaxRes%, VideoRam%       ' Find what's installed
  131.  
  132. '   Set display colours for colour and monochrome displays.
  133. '
  134.     IF Colour% THEN
  135.        BarColour% = 48                          ' Black on Cyan
  136.        HeadColour% = 31                         ' Bright White on Blue
  137.        StatColour% = 48                         ' Black on Cyan
  138.        TextColour% = 112                        ' Black on White
  139.     ELSE
  140.        BarColour% = 112                         ' Reverse video
  141.        HeadColour% = 15                         ' Intense White on Black
  142.        StatColour% = 112                        ' Reverse video
  143.        TextColour% = 7                          ' White on Black
  144.     END IF
  145.  
  146. '   Check the type of display adaptor installed.
  147. '
  148.     SELECT CASE MaxRes%
  149.         CASE 13
  150.              IF VideoRam% = 64 THEN
  151.                 Adaptor$ = "Multi-Colour Graphics Array"
  152.              ELSE
  153.                 Adaptor$ = "Video Graphics Array"
  154.              END IF
  155.         CASE 7 TO 10
  156.              Adaptor$ = "Enhanced Graphics Adaptor"
  157.         CASE 3
  158.              Adaptor$ = "Hercules Graphics Card"
  159.         CASE 2
  160.              Adaptor$ = "Colour Graphics Adaptor"
  161.         CASE ELSE
  162.              Adaptor$ = "Monochrome Display Adaptor"
  163.     END SELECT
  164.  
  165.     Mouse% = MouseInit%                         ' See if a mouse is available
  166.  
  167.     DIM Menu$(0 TO 12)                          ' Dimension array for menus
  168.     Printer% = 1                                ' Use the first parallel port
  169.     RootName$ = "DEMON"                         ' Used for help topic files
  170.     DOS$ = "DOS " + DosVersion$                 ' Check current DOS version
  171.     Lc$ = "abcdefghijklmnopqrstuvwxyz"          ' Lowercase letters
  172.     Uc$ = UCASE$(Lc$)                           ' Uppercase letters
  173.     Nu$ = "0123456789"                          ' Numerals
  174.     VFln$ = "\._^$~!#%&-@`({})'"                ' Legal pathname characters
  175.  
  176.     DY$ = MID$(DATE$, 4, 2): DY% = VAL(DY$)     ' What day is this?
  177.     MO$ = LEFT$(DATE$, 2): MO% = VAL(MO$)       ' What month is this?
  178.     YR$ = RIGHT$(DATE$, 2): YR% = VAL(YR$)      ' What year is this?
  179.     Now$ = DY$ + "/" + MO$ + "/" + YR$          ' Format it as DD/MM/YY
  180.  
  181.     ToDay$ = LongDate$(DY%, MO%, YR%)           ' Translate date into words
  182.  
  183. '┌────────────────────────────────────────────────────────────────────────┐
  184. '│      Main Menu.                                                        │
  185. '└────────────────────────────────────────────────────────────────────────┘
  186. '
  187.     ReSeed TIMER
  188. D001:
  189.     Head$ = "ASSEMBLY-LANGUAGE TOOLBOX FOR QuickBASIC"
  190.     LOCATE , , 0: Frame Head$, 1: Bar% = 1
  191. D002:
  192.     IF MaxRes% < 1 THEN
  193.        Menu$(0) = "WSFKME X"
  194.     ELSE
  195.        Menu$(0) = "WSFKMEGX"
  196.     END IF
  197.     Menu$(1) = "&Windows": Menu$(2) = "&Screen"
  198.     Menu$(3) = "&Files": Menu$(4) = "&Keyboard"
  199.     Menu$(5) = "&Memory": Menu$(6) = "&Examples"
  200.     Menu$(7) = "&Graphics": Menu$(8) = "E&xit"
  201.     Abort% = FALSE: HotKey% = FALSE
  202.     IF Nxt% THEN
  203.        IF Bar% = 1 THEN Bar% = 8
  204.        IF Bar% = 9 THEN Bar% = 2
  205.     END IF
  206.     BarMenu 3, BarColour%, 8, Menu$(), Bar%, Nxt%, 1, RootName$, Mouse%
  207.     SELECT CASE Bar%
  208.         CASE 1
  209.              GOTO D100
  210.         CASE 2
  211.              GOTO D200
  212.         CASE 3
  213.              GOTO D300
  214.         CASE 4
  215.              GOTO D400
  216.         CASE 5
  217.              GOTO D500
  218.         CASE 6
  219.              GOTO D600
  220.         CASE 7
  221.              GOTO D700
  222.         CASE 8
  223.              GOTO D800
  224.         CASE ELSE
  225.              Ok% = Verify%(1, 9, "Exit program, are you sure", 0, Mouse%)
  226.              IF Ok% THEN GOTO Egress
  227.     END SELECT
  228. GOTO D002
  229.  
  230. '┌────────────────────────────────────────────────────────────────────────┐
  231. '│      Popup Window Demonstration.                                       │
  232. '└────────────────────────────────────────────────────────────────────────┘
  233. '
  234. D100:
  235.     A$ = STRING$(1680, "░"): FastPrint 4, 1, A$, 30
  236.     FastPrint 25, 1, SPACE$(80), StatColour%: A$ = ""
  237.     FastPrint 25, 2, Adaptor$, StatColour%
  238.     FastPrint 25, 71, DOS$, StatColour%
  239.     FOR M% = 1 TO 3
  240.         Area% = 0: O% = 0: B% = 1
  241.         DO
  242.             H% = Rand%(5, 10): W% = Rand%(14, 40)
  243.             Area% = Area% + (H% + 1) * (W% + 1)
  244.             IF Area% > 7200 THEN EXIT DO
  245.             K% = Rand%(4, 24 - H%): J% = Rand%(1, 79 - W%)
  246.             R% = Rand%(1, 4): S% = Rand%(1, 4)
  247.             Attrib% = Attribute%(15, B%)
  248.             PopUp K%, J%, H%, W%, Attrib%, R%, S%, -1
  249.             FastPrint K%, J% + ((W% \ 2) - 5), "[ WINDOW ]", Attrib%
  250.             O% = O% + 1: B% = B% + 1: IF B% > 6 THEN B% = 1
  251.          LOOP UNTIL O% = 30
  252.          IF (M% = 3) THEN SLEEP 3 ELSE SLEEP 1
  253.          FOR I% = O% TO 1 STEP -1
  254.              ShutUp -1
  255.          NEXT I%
  256.     NEXT M%
  257.     PopUp 4, 15, 10, 30, 52, 4, 1, -1: PopUp 3, 36, 13, 40, 47, 3, 1, -1
  258.     PopUp 9, 10, 13, 40, 31, 2, 1, -1: PopUp 12, 42, 11, 36, 67, 1, 1, -1
  259.     PopUp 2, 31, 5, 20, 78, 2, 1, -1: FastPrint 4, 34, "Presenting ...", 78
  260.     SLEEP 3: KeyFlush: Attrib% = Attribute%(0, 7)
  261.     PopUp 8, 20, 7, 40, Attrib%, 2, 1, -1
  262.     FastPrint 8, 31, "[ QUICK  WINDOWS ]", Attrib%
  263.     FastPrint 10, 29, "Windowing Routines for", Attrib%
  264.     FastPrint 11, 30, "Microsoft QuickBASIC", Attrib%
  265.     SLEEP 3: KeyFlush: Attrib% = Attribute%(0, 3)
  266.     PopUp 17, 55, 7, 24, Attrib%, 1, 3, -1
  267.     FastPrint 19, 66, "By", Attrib%
  268.     FastPrint 20, 59, "Christy  Gemmell", Attrib%
  269.     FastPrint 21, 57, "with acknowledgement", Attrib%
  270.     FastPrint 22, 58, "to Rick Fothergill", Attrib%
  271.     SLEEP 3: KeyFlush: Attrib% = Attribute%(14, 1)
  272.     PopUp 13, 2, 10, 23, Attrib%, 2, 4, 0
  273.     FastPrint 15, 4, "A Library of screen", Attrib%
  274.     FastPrint 16, 4, "handling procedures", Attrib%
  275.     FastPrint 17, 4, "and functions which", Attrib%
  276.     FastPrint 18, 4, "can be incorporated", Attrib%
  277.     FastPrint 19, 4, "in your QuickBASIC", Attrib%
  278.     FastPrint 20, 9, "programs.", Attrib%
  279.     SLEEP 4: KeyFlush: Attrib% = Attribute%(15, 1)
  280.     PopUp 16, 27, 5, 26, Attrib%, 2, 1, 0
  281.     FastPrint 18, 30, "HOLD ONTO YOUR HATS", Attrib%
  282.     SLEEP 2: KeyFlush: FOR I% = 1 TO 9: ShutUp -1: NEXT
  283.     Attrib% = 112: PopUp 9, 16, 8, 50, Attrib%, 2, 2, 0: RESTORE Blurb
  284.     FOR I% = 10 TO 15: READ Me$: FastPrint I%, 19, Me$, Attrib%: NEXT
  285.     SLEEP 6: KeyFlush: Scroll 1, 10, 17, 15, 64, 0, Attrib%
  286.     FOR I% = 12 TO 13: READ Me$: FastPrint I%, 19, Me$, Attrib%: NEXT
  287.     SLEEP 5: KeyFlush: IF Colour% THEN Attrib% = Attribute%(1, 2)
  288.     PopUp 5, 5, 6, 35, Attrib%, 0, 1, -1
  289.     SLEEP 3: ShutUp -1: Scroll 1, 10, 17, 15, 64, 0, 112
  290.     FOR I% = 12 TO 13: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  291.     SLEEP 6: KeyFlush: IF Colour% THEN Attrib% = Attribute%(15, 6)
  292.     PopUp 6, 5, 8, 35, Attrib%, 0, 2, -1
  293.     FastPrint 6, 15, "[  No  Frame  ]", Attrib%
  294.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(11, 1)
  295.     PopUp 7, 8, 8, 35, Attrib%, 1, 2, -1
  296.     FastPrint 7, 17, "[ Frame Style 1 ]", Attrib%
  297.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(0, 2)
  298.     PopUp 8, 11, 8, 35, Attrib%, 2, 2, -1
  299.     FastPrint 8, 20, "[ Frame Style 2 ]", Attrib%
  300.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(0, 3)
  301.     PopUp 9, 14, 8, 35, Attrib%, 3, 2, -1
  302.     FastPrint 9, 23, "[ Frame Style 3 ]", Attrib%
  303.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(14, 4)
  304.     PopUp 10, 17, 8, 35, Attrib%, 4, 2, -1
  305.     FastPrint 10, 26, "[ Frame Style 4 ]", Attrib%
  306.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(12, 5)
  307.     PopUp 11, 20, 8, 35, Attrib%, 5, 2, -1
  308.     FastPrint 11, 29, "[ Frame Style 5 ]", Attrib%
  309.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(13, 6)
  310.     PopUp 12, 23, 8, 35, Attrib%, 6, 2, -1
  311.     FastPrint 12, 32, "[ Frame Style 6 ]", Attrib%
  312.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(15, 2)
  313.     PopUp 13, 26, 8, 35, Attrib%, 7, 2, -1
  314.     FastPrint 13, 35, "[ Frame Style 7 ]", Attrib%
  315.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(1, 3)
  316.     PopUp 14, 29, 8, 35, Attrib%, 8, 2, -1
  317.     FastPrint 14, 39, "[ Frame Style 8 ]", Attrib%
  318.     SLEEP 4: KeyFlush: FOR I% = 1 TO 9: ShutUp -1: NEXT
  319.     Scroll 1, 10, 17, 15, 64, 0, 112
  320.     FOR I% = 11 TO 13: READ Me$: FastPrint I%, 20, Me$, 112: NEXT
  321.     SLEEP 6: KeyFlush
  322.     FOR I% = 1 TO 15
  323.         Label$ = "[ Colour:" + STR$(I%) + " ]"
  324.         J% = Rand%(1, 51): K% = Rand%(1, 13)
  325.         Attrib% = Attribute%(I%, 0)
  326.         PopUp K% + 1, J% + 1, 7, 24, Attrib%, 4, 0, 0
  327.         FastPrint K% + 1, J% + 6, Label$, Attrib%
  328.         SLEEP 1: KeyFlush
  329.     NEXT I%
  330.     Attrib% = Attribute%(31, B%)
  331.     PopUp 7, 20, 7, 24, Attrib%, 4, 2, 0
  332.     FastPrint 7, 25, "[ Colour: 31 ]", Attrib%
  333.     SLEEP 4: KeyFlush: FOR I% = 1 TO 16: ShutUp 0: NEXT
  334.     Scroll 1, 10, 17, 15, 64, 0, 112
  335.     FOR I% = 12 TO 13: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  336.     SLEEP 6: KeyFlush: Attrib% = Attribute%(15, 1)
  337.     PopUp 2, 2, 11, 30, Attrib%, 7, 0, 0
  338.     SLEEP 3: KeyFlush: ShutUp 0: Scroll 1, 10, 17, 15, 64, 0, 112
  339.     FOR I% = 12 TO 13: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  340.     SLEEP 6: KeyFlush: Attrib% = Attribute%(14, 5)
  341.     PopUp 5, 5, 10, 30, Attrib%, 2, 1, 0
  342.     FastPrint 9, 14, "Left Shadow", Attrib%
  343.     SLEEP 2: KeyFlush: Attrib% = Attribute%(0, 2)
  344.     PopUp 5, 45, 10, 30, Attrib%, 2, 2, 0
  345.     FastPrint 9, 54, "Right Shadow", Attrib%
  346.     SLEEP 2: KeyFlush: ShutUp 0: ShutUp 0
  347.     Scroll 1, 10, 17, 15, 64, 0, 112
  348.     FastPrint 12, 31, "Windows can be zoomed", 112
  349.     FastPrint 13, 33, "onto the screen.", 112
  350.     SLEEP 3: KeyFlush: Attrib% = Attribute%(0, 2)
  351.     PopUp 2, 2, 15, 60, Attrib%, 2, 0, -1
  352.     SLEEP 2: KeyFlush: Attrib% = Attribute%(0, 3)
  353.     PopUp 13, 10, 10, 60, Attrib%, 3, 0, -1
  354.     SLEEP 2: KeyFlush: Attrib% = Attribute%(14, 5)
  355.     PopUp 7, 33, 10, 45, Attrib%, 1, 0, -1
  356.     SLEEP 2: KeyFlush: Attrib% = Attribute%(15, 4)
  357.     IF NOT Colour% THEN Attrib% = 112
  358.     PopUp 7, 10, 12, 63, Attrib%, 2, 1, -1
  359.     FastPrint 12, 32, "<<< W O W >>>", Attrib%
  360.     SLEEP 3: KeyFlush: FOR I% = 1 TO 4: ShutUp -1: NEXT
  361.     Scroll 1, 10, 17, 15, 64, 0, 112
  362.     FOR I% = 10 TO 14: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  363.     SLEEP 6: KeyFlush: Scroll 1, 10, 17, 15, 64, 0, 112
  364.     FOR I% = 10 TO 15: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  365.     SLEEP 6: KeyFlush: Scroll 1, 10, 17, 15, 64, 0, 112
  366.     FOR I% = 10 TO 15: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  367.     SLEEP 6: KeyFlush: Attrib% = Attribute%(0, 2)
  368.     PopUp 3, 5, 15, 45, Attrib%, 4, 1, -1
  369.     FastPrint 9, 14, "This is the first level ...", Attrib%
  370.     SLEEP 2: KeyFlush: Attrib% = Attribute%(15, 4)
  371.     PopUp 6, 29, 17, 50, Attrib%, 4, 1, -1
  372.     FastPrint 12, 40, "This is the second level ...", Attrib%
  373.     SLEEP 2: KeyFlush: Attrib% = Attribute%(0, 3)
  374.     PopUp 9, 22, 15, 35, Attrib%, 4, 1, -1
  375.     FastPrint 16, 26, "This is the third level ...", Attrib%
  376.     SLEEP 2: KeyFlush: FastPrint 16, 26, "Now to go back ...         ", Attrib%
  377.     SLEEP 1: ShutUp -1: SLEEP 1: ShutUp -1: SLEEP 1: ShutUp -1: SLEEP 2
  378.     Scroll 1, 10, 17, 15, 64, 0, 112: KeyFlush
  379.     FOR I% = 10 TO 15: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  380.     Ok% = Verify%(1, 9, "Are you enjoying this program", 0, Mouse%)
  381.     Scroll 1, 10, 17, 15, 64, 0, 112
  382.     IF Ok% THEN
  383.        FastPrint 11, 28, "You sound very positive!", 112
  384.     ELSE
  385.        FastPrint 11, 28, "You sound very negative!", 112
  386.     END IF
  387.     SLEEP 2: KeyFlush: Scroll 1, 10, 17, 15, 64, 0, 112
  388.     FOR I% = 10 TO 15: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  389.     SLEEP 3: KeyFlush: SL% = StatusLine%("Want to carry on?")
  390.     IF SL% = 78 OR SL% = 110 OR SL% = 27 THEN
  391.        ShutUp -1
  392.     ELSE
  393.        A$ = STRING$(44, SL%)
  394.        FOR I% = 10 TO 15: FastPrint I%, 19, A$, 112: NEXT
  395.        SLEEP 6: KeyFlush: Scroll 1, 10, 17, 15, 64, 0, 112
  396.        FOR I% = 10 TO 15: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  397.        SLEEP 6: KeyFlush: Scroll 1, 10, 17, 15, 64, 0, 112
  398.        Ready% = PrinTest%(Printer%)
  399.        IF Ready% THEN
  400.           FastPrint 11, 30, "PRINTER CONTROL MENU", 112
  401.           FastPrint 13, 24, "The Toolbox contains versions for", 112
  402.           FastPrint 14, 27, "two other popular printers.", 112
  403.           FastPrint 25, 2, "Press <ESC> to Abort       ", StatColour%
  404.           PrintSet 4, 51, 0, Printer%, Mouse%
  405.           FastPrint 25, 1, SPACE$(80), StatColour%
  406.           FastPrint 25, 2, Adaptor$, StatColour%
  407.           FastPrint 25, 71, DOS$, StatColour%
  408.           SLEEP 5: KeyFlush
  409.        END IF
  410.        ShutUp -1
  411.        PopUp 4, 15, 10, 30, 52, 4, 1, -1
  412.        PopUp 3, 36, 13, 40, 47, 3, 1, -1
  413.        PopUp 9, 10, 13, 40, 78, 2, 1, -1
  414.        PopUp 12, 42, 11, 36, 67, 1, 1, -1
  415.        PopUp 9, 16, 8, 52, 112, 2, 1, -1
  416.        FastPrint 11, 20, "The video routines in the Toolbox Library", 112
  417.        FastPrint 12, 20, "give you all you need to create powerful", 112
  418.        FastPrint 13, 20, "and professional screen displays in your", 112
  419.        FastPrint 14, 20, "QuickBASIC programs.", 112: SLEEP 9: KeyFlush
  420.        FOR I% = 1 TO 5: ShutUp -1: SLEEP 1: KeyFlush: NEXT
  421.        IF NOT Ready% THEN
  422.           PopUp 10, 18, 5, 44, 96, 1, 2, 0
  423.           Me$ = "Pity you didn't have a printer connected"
  424.           FastPrint 12, 20, Me$, 96: SLEEP 5: KeyFlush: ShutUp 0
  425.        END IF
  426.     END IF
  427. GOTO D001
  428.  
  429. '┌────────────────────────────────────────────────────────────────────────┐
  430. '│      Screen control functions.                                         │
  431. '└────────────────────────────────────────────────────────────────────────┘
  432. '
  433. D200:
  434.     Menu$(0) = "F#SC#B"
  435.     Menu$(1) = "&Fast screen printing"
  436.     Menu$(3) = "&Selective scrolling"
  437.     Menu$(4) = "&Clear to the end"
  438.     Menu$(6) = "&Background colours"
  439.     VerMenu 4, 3, BarColour%, 1, 6, "SCREEN CONTROL", Menu$(),_
  440.             Choice%, Nxt%, Bar%, 1, RootName$, Mouse%
  441.     IF Nxt% THEN GOTO D002
  442.     SELECT CASE Choice%
  443.         CASE 1
  444.              GOTO D210
  445.         CASE 3
  446.              GOTO D220
  447.         CASE 4
  448.              GOTO D230
  449.         CASE 6
  450.              GOTO D240
  451.         CASE ELSE
  452.     END SELECT
  453. GOTO D002
  454.  
  455. '   Screen print demonstration
  456. '
  457. D210:
  458.     A$ = STRING$(1680, "«"): B$ = STRING$(1680, "»")
  459.     FOR I% = 1 TO 255
  460.         FastPrint 4, 1, A$, I%: FastPrint 4, 1, B$, I%
  461.         IF INKEY$ = CHR$(27) THEN EXIT FOR
  462.     NEXT I%
  463.     IF I% = 256 THEN
  464.        A$ = "": B$ = "": C$ = STRING$(1680, "░"): Attrib% = 30
  465.        FastPrint 4, 1, C$, Attrib%: C$ = ""
  466.        IF Colour% THEN Attrib% = 48 ELSE Attrib% = 112
  467.        PopUp 12, 21, 7, 40, Attrib%, 3, 4, -1
  468.        FastPrint 15, 33, "<<< W O W >>>", Attrib%
  469.        SLEEP 5: KeyFlush: ShutUp -1
  470.     END IF
  471. GOTO D200
  472.  
  473. '   Selective scrolling demonstration
  474. '
  475. D220:
  476.     Panel 4, 1, 21, 80, 1, TextColour%
  477.     IF Colour% THEN BackGround% = 7 ELSE BackGround% = 0
  478.     Clr% = 1: IF Mouse% THEN MouseShow
  479.     DO
  480.        Scroll 0, 4, 21, 7, 60, 1, Attribute%(0, Clr%)
  481.        Scroll 2, 9, 6, 19, 20, 1, Attribute%(0, Clr%)
  482.        Scroll 3, 9, 61, 19, 75, 1, Attribute%(0, Clr%)
  483.        Scroll 1, 21, 21, 24, 60, 1, Attribute%(0, Clr%)
  484.        COLOR Clr%, BackGround%
  485.        LOCATE 19, 25: PRINT "SCROLLING UP";
  486.        Scroll 0, 9, 23, 19, 38, 1, Attribute%(Clr%, BackGround%)
  487.        LOCATE 9, 43: PRINT "SCROLLING DOWN";
  488.        Scroll 1, 9, 41, 19, 58, 1, Attribute%(Clr%, BackGround%)
  489.        Pause 1: Clr% = Clr% + 1
  490.        IF Clr% = BackGround% THEN Clr% = Clr% + 1
  491.        IF Clr% > 7 THEN Clr% = 1
  492.        IF Mouse% THEN
  493.           MouseNow leftButton%, rightButton%, xMouse%, yMouse%
  494.           IF leftButton% THEN
  495.              IF yMouse% > 15 AND yMouse% < 24 THEN
  496.                 Z$ = CHR$(32): EXIT DO
  497.              END IF
  498.           END IF
  499.        END IF
  500.        Z$ = INKEY$
  501.     LOOP UNTIL Z$ = CHR$(27)
  502.     IF Mouse% THEN
  503.        CALL MouseHide: IF Z$ <> CHR$(27) THEN GOTO D002
  504.     END IF
  505. GOTO D200
  506.  
  507. '   Clear to end of line or screen
  508. '
  509. D230:
  510.     Panel 4, 1, 24, 80, 1, TextColour%
  511.     IF Colour% THEN Attrib% = 15 ELSE Attrib% = 112
  512.     FastPrint 22, 30, "Press a key to do it", TextColour%
  513.     FastPrint 10, 3, "Clear end of line >", TextColour%
  514.     LOCATE 10, 22, 1: R$ = INPUT$(1): ClearEnd 0, Attrib%
  515.     FastPrint 15, 3, "Clear end of screen >", TextColour%
  516.     LOCATE 15, 24, 1: R$ = INPUT$(1): ClearEnd 1, Attrib%
  517.     LOCATE , , 0: Frame Head$, 0
  518. GOTO D200
  519.  
  520. D240:
  521.     FastPrint 25, 1, SPACE$(80), StatColour%
  522.     FastPrint 25, 3, "Press any key, <Esc> to abort", StatColour%
  523.     RANDOMIZE TIMER: IF Mouse% THEN MouseShow
  524.     DO
  525.        Row% = Rand%(5, 20): Col% = Rand%(2, 62): Rows% = Rand%(1, 16)
  526.        IF Row% + Rows% > 23 THEN Rows% = 24 - Row%
  527.        Cols% = Rand%(1, 60): IF Col% + Cols% > 78 THEN Cols% = 79 - Col%
  528.        Attrib% = Rand%(0, 255): BackFill Row%, Col%, Rows%, Cols%, Attrib%
  529.        DO
  530.           IF Mouse% THEN
  531.              MouseNow leftButton%, rightButton%, xMouse%, yMouse%
  532.              IF leftButton% THEN
  533.                 IF yMouse% > 15 AND yMouse% < 24 THEN
  534.                    Z$ = CHR$(27)
  535.                    EXIT DO
  536.                 ELSE
  537.                    Z$ = CHR$(32)
  538.                    EXIT DO
  539.                 END IF
  540.              END IF
  541.           END IF
  542.           Z$ = INKEY$
  543.        LOOP UNTIL Z$ <> ""
  544.     LOOP UNTIL Z$ = CHR$(27)
  545.     Frame Head$, 0: IF Mouse% THEN MouseHide:
  546.     IF Z$ <> CHR$(27) THEN GOTO D002
  547. GOTO D200
  548.  
  549. '┌────────────────────────────────────────────────────────────────────────┐
  550. '│      File Functions.                                                   │
  551. '└────────────────────────────────────────────────────────────────────────┘
  552. '
  553. D300:
  554.     Menu$(0) = "WH#S"
  555.     Menu$(1) = "&Where's that file?"
  556.     Menu$(2) = "&How big is that file?"
  557.     Menu$(4) = "&Sort that file"
  558.     Abort% = FALSE
  559.     VerMenu 4, 9, BarColour%, 1, 4, "FILE FUNCTIONS", Menu$(),_
  560.             Choice%, Nxt%, Bar%, 1, RootName$, Mouse%
  561.     IF Nxt% THEN GOTO D002
  562.     SELECT CASE Choice%
  563.         CASE 1
  564.              GOTO D310
  565.         CASE 2
  566.              GOTO D320
  567.         CASE 4
  568.              GOTO D330
  569.         CASE ELSE
  570.     END SELECT
  571. GOTO D002
  572.  
  573. '   File Finder
  574. '
  575. D310:
  576.     Panel 4, 1, 21, 80, 1, TextColour%
  577.     RESTORE Finder
  578.     FOR I% = 1 TO 13
  579.         READ Me$: FastPrint 5 + I%, 14, Me$, TextColour%
  580.     NEXT I%
  581.     Scroll 1, 19, 2, 21, 79, 0, TextColour%
  582.     PopUp 19, 19, 4, 44, 96, 2, 2, -1: HotKey% = FALSE
  583.     FastPrint 20, 28, "Enter name of file to find", 96
  584.     LOCATE 21, 21: Legal$ = Uc$ + Lc$ + Nu$ + VFln$ + ":*?"
  585.     PathName$ = RevInput$(40, "", Legal$, 1, "REVINPUT", 0, HotKey%)
  586.     ShutUp -1
  587.     IF HotKey% THEN
  588.        Abort% = TRUE
  589.     ELSE
  590.        PathName$ = RTRIM$(LTRIM$(PathName$))
  591.        Found$ = FindFile$(PathName$, 0, Mouse%)
  592.        IF Found$ <> "" THEN
  593.           Found$ = LTRIM$(RTRIM$(Found$))
  594.           OT% = 40 - (LEN(Found$) \ 2)
  595.           FastPrint 20, OT%, Found$, TextColour%
  596.        END IF
  597.     END IF
  598. GOTO D300
  599.  
  600. D320:
  601.     Panel 4, 1, 21, 80, 1, TextColour%
  602.     RESTORE Size
  603.     FOR I% = 1 TO 12
  604.         READ Me$: FastPrint 5 + I%, 8, Me$, TextColour%
  605.     NEXT I%
  606.     Scroll 1, 18, 3, 23, 78, 0, TextColour%: HotKey% = FALSE
  607.     LOCATE 20, 8: Legal$ = Uc$ + Lc$ + Nu$ + VFln$ + "*?"
  608.     PathName$ = RevInput$(64, "", Legal$, 1, "REVINPUT", 0, HotKey%)
  609.     IF HotKey% THEN
  610.        Abort% = TRUE
  611.     ELSE   
  612.        PathName$ = LTRIM$(RTRIM$(PathName$))
  613.        IF PathName$ = "" THEN PathName$ = "*.*"
  614.        IF IsDir%(PathName$) THEN PathName$ = PathName$ + "\*.*"
  615.        FastPrint 20, 8, SPACE$(64), TextColour%
  616.        FastPrint 20, 8, PathName$, TextColour%
  617.        Bytes& = SizeOf&(PathName$)
  618.        IF Bytes& > 0 THEN
  619.           Me$ = "Size = " + LTRIM$(RTRIM$(STR$(Bytes&))) + " bytes"
  620.           FastPrint 22, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  621.        ELSE
  622.           MisTake 9, "No match found!", 0, Mouse%
  623.        END IF
  624.     END IF
  625. GOTO D300
  626.  
  627. '   File sorter.
  628. '
  629. D330:
  630.     Panel 4, 1, 21, 80, 1, TextColour%
  631.     RESTORE Sorts
  632.     FOR I% = 1 TO 10
  633.         READ Me$: FastPrint 4 + I%, 8, Me$, TextColour%
  634.     NEXT I%
  635.     IF SizeOf&("SAMPLE.DAT") < 1 THEN
  636.        MisTake 9, "Can't find SAMPLE data file to sort!", 0, Mouse%
  637.     ELSE
  638.        IF Colour% THEN Attrib% = 32 ELSE Attrib% = 112
  639.        PopUp 16, 3, 8, 74, Attrib%, 1, 4, -1
  640.        FastPrint 16, 36, " SAMPLE.DAT ", Attrib%
  641.        OPEN "SAMPLE.DAT" FOR INPUT AS #1
  642.        FOR I% = 1 TO 6
  643.            LINE INPUT #1, A$: OL% = LEN(A$)
  644.            Me$ = LEFT$(A$, OL% - 2)
  645.            FastPrint 16 + I%, 40 - (OL% \ 2) + 1, Me$, Attrib%
  646.        NEXT I%
  647.        CLOSE 1: SL% = StatusLine%("To begin sorting ...")
  648.        SortFile "SAMPLE.DAT", 1, 10, OL% + 2, Done%
  649.        IF Done% THEN
  650.           OPEN "SAMPLE.DAT" FOR INPUT AS #1
  651.           FOR I% = 1 TO 6
  652.               LINE INPUT #1, A$: OL% = LEN(A$)
  653.               Me$ = LEFT$(A$, OL% - 2)
  654.               FastPrint 16 + I%, 40 - (OL% \ 2) + 1, Me$, Attrib%
  655.           NEXT I%
  656.           CLOSE 1
  657.           SL% = StatusLine%("File successfully sorted"): ShutUp -1
  658.        ELSE
  659.           ShutUp -1
  660.           FastPrint 21, 30, "Unable to sort file", TextColour%
  661.        END IF
  662.     END IF
  663. GOTO D300
  664.  
  665. '┌────────────────────────────────────────────────────────────────────────┐
  666. '│      Keyboard functions and procedures.                                │
  667. '└────────────────────────────────────────────────────────────────────────┘
  668. '
  669. D400:
  670.     Menu$(0) = "AKT#M"
  671.     Menu$(1) = "&ASCII and scan codes"
  672.     Menu$(2) = "&Keyboard shift flags"
  673.     Menu$(3) = "&Typeahead buffer"
  674.     Menu$(5) = "&Mouse position and status"
  675.     VerMenu 4, 16, BarColour%, 1, 5, "KEYBOARD AND MOUSE", Menu$(),_
  676.             Choice%, Nxt%, Bar%, 1, RootName$, Mouse%
  677.     IF Nxt% THEN GOTO D002
  678.     SELECT CASE Choice%
  679.         CASE 1
  680.              GOTO D410
  681.         CASE 2
  682.              GOTO D420
  683.         CASE 3
  684.              GOTO D430
  685.         CASE 5
  686.              GOTO D440
  687.         CASE ELSE
  688.     END SELECT
  689. GOTO D002
  690.  
  691. '   Indexes to the font table in ROM-BIOS, then translates the pixel
  692. '   values of the character specified by a keypress, into a large-
  693. '   scale representation of that character.
  694. '
  695. D410:
  696.     Panel 4, 1, 21, 80, 1, TextColour%
  697.     Fore$ = STRING$(2, "█"): Back$ = STRING$(2, "░")
  698.     FastPrint 6, 31, "┌────────────────┐", TextColour%
  699.     FOR Row% = 7 TO 14
  700.         FastPrint Row%, 31, "│" + STRING$(16, "░") + "│", TextColour%
  701.     NEXT Row%
  702.     FastPrint 15, 31, "└────────────────┘", TextColour%
  703.     FastPrint 25, 1, SPACE$(80), StatColour%
  704.     FastPrint 25, 3, "Press any key, or <Esc> to abort", StatColour%
  705.     LOCATE 21, 40, 1: Abort% = FALSE: CALL KeyFlush
  706.     DO
  707.         Character% = KeyIn%: IF Character% = 27 THEN EXIT DO
  708.         FastPrint 21, 40, " ", TextColour%
  709.         FastPrint 16, 10, SPACE$(60), TextColour%
  710.         SELECT CASE Character%
  711.             CASE 0 TO 127
  712.                  FOR Row% = 1 TO 8
  713.                      Pixel% = FarPeek%(&HF000, &HFA6D + (Character% * 8)_
  714.                                        + Row%)
  715.                      IF Pixel% = 0 THEN
  716.                         FastPrint Row% + 6, 32, STRING$(16, "░"), TextColour%
  717.                      ELSE
  718.                         Col% = 32
  719.                         FOR Column% = 7 TO 0 STEP -1
  720.                             IF Pixel% < 2 ^ Column% THEN
  721.                                FastPrint Row% + 6, Col%, Back$, TextColour%
  722.                             ELSE
  723.                                FastPrint Row% + 6, Col%, Fore$, TextColour%
  724.                                Pixel% = Pixel% - 2 ^ Column%
  725.                             END IF
  726.                             Col% = Col% + 2
  727.                         NEXT Column%
  728.                      END IF
  729.                  NEXT Row%
  730.             CASE ELSE
  731.                  IF Character% < 0 THEN
  732.                     Me$ = SPACE$(16)
  733.                  ELSE
  734.                     Me$ = STRING$(16, Character%)
  735.                  END IF
  736.                  FOR Row% = 1 TO 8
  737.                      FastPrint Row% + 6, 32, Me$, TextColour%
  738.                  NEXT Row%
  739.         END SELECT
  740.         IF Character% < 0 THEN
  741.            Me$ = "Scan Code " + LTRIM$(RTRIM$(STR$(ABS(Character%))))
  742.         ELSE
  743.            Me$ = "ASCII Code " + LTRIM$(RTRIM$(STR$(Character%)))
  744.         END IF
  745.         FastPrint 16, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  746.     LOOP WHILE 1
  747.     LOCATE , , 0: Frame Head$, 0
  748. GOTO D400
  749.  
  750. '   Keyboard shift flags.
  751. '
  752. D420:
  753.     Panel 4, 1, 21, 80, 1, TextColour%
  754.     ShiftFlags% = KeyFlags%: Flag$ = STRING$(16, "0")
  755.     FOR I% = 15 TO 0 STEP -1
  756.         IF BitTest%(ShiftFlags%, I%) THEN
  757.            MID$(Flag$, 16 - I%, 1) = "1"
  758.         END IF
  759.     NEXT I%
  760.     FastPrint 5, 40, "Keyboard Status Word at 0040:0017", TextColour%
  761.     FastPrint 7, 40, "Bit settings (1 = set)", TextColour%
  762.     FastPrint 5, 3, " F E D C B A 9 8 7 6 5 4 3 2 1 0", TextColour%
  763.     FastPrint 6, 3, "┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐", TextColour%
  764.     FastPrint 7, 3, "│", TextColour%: Col% = 4
  765.     FOR I% = 1 TO 16
  766.         FastPrint 7, Col%, MID$(Flag$, I%, 1) + "│", TextColour%
  767.         Col% = Col% + 2
  768.     NEXT I%
  769.     FastPrint 8, 3, "└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘", TextColour%
  770.     FastPrint 9, 3, " │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─┴─", TextColour%
  771.     FastPrint 10, 3, " │ │ │ │ │ │ │ │ │ │ │ │ │ └─────", TextColour%
  772.     FastPrint 11, 3, " │ │ │ │ │ │ │ │ │ │ │ │ └───────", TextColour%
  773.     FastPrint 12, 3, " │ │ │ │ │ │ │ │ │ │ │ └─────────", TextColour%
  774.     FastPrint 13, 3, " │ │ │ │ │ │ │ │ │ │ └───────────", TextColour%
  775.     FastPrint 14, 3, " │ │ │ │ │ │ │ │ │ └─────────────", TextColour%
  776.     FastPrint 15, 3, " │ │ │ │ │ │ │ │ └───────────────", TextColour%
  777.     FastPrint 16, 3, " │ │ │ │ │ │ │ └─────────────────", TextColour%
  778.     FastPrint 17, 3, " │ │ │ │ │ │ └───────────────────", TextColour%
  779.     FastPrint 18, 3, " │ │ │ │ │ └─────────────────────", TextColour%
  780.     FastPrint 19, 3, " │ │ │ │ └───────────────────────", TextColour%
  781.     FastPrint 20, 3, " │ │ │ └─────────────────────────", TextColour%
  782.     FastPrint 21, 3, " │ │ └───────────────────────────", TextColour%
  783.     FastPrint 22, 3, " │ └─────────────────────────────", TextColour%
  784.     FastPrint 23, 3, " └───────────────────────────────", TextColour%
  785.     FastPrint 25, 1, SPACE$(80), StatColour%
  786.     FastPrint 25, 3, "Press <Esc> to abort", StatColour%
  787.     RESTORE Shift
  788.     FOR I% = 1 TO 15
  789.         READ Me$: FastPrint I% + 8, 40, Me$, TextColour%
  790.     NEXT I%
  791.     IF Mouse% THEN MouseShow
  792.     DO
  793.         ShiftFlags% = KeyFlags%
  794.         FOR I% = 15 TO 0 STEP -1
  795.             IF BitTest%(ShiftFlags%, I%) THEN
  796.                MID$(Flag$, 16 - I%, 1) = "1"
  797.             ELSE
  798.                MID$(Flag$, 16 - I%, 1) = "0"
  799.             END IF
  800.         NEXT I%
  801.         Col% = 4
  802.         FOR I% = 1 TO 16
  803.             FastPrint 7, Col%, MID$(Flag$, I%, 1) + "│", TextColour%
  804.             Col% = Col% + 2
  805.         NEXT I%
  806.         CL% = CapsLock%(2)
  807.         IF CL% THEN
  808.            FastPrint 25, 65, "CAPS", 14
  809.         ELSE
  810.            FastPrint 25, 65, "    ", StatColour%
  811.         END IF
  812.         NL% = NumLock%(2)
  813.         IF NL% THEN
  814.            FastPrint 25, 70, "NUM", 14
  815.         ELSE
  816.            FastPrint 25, 70, "   ", StatColour%
  817.         END IF
  818.         SL% = ScrLock%(2)
  819.         IF SL% THEN
  820.            FastPrint 25, 74, "SCRL", 14
  821.         ELSE
  822.            FastPrint 25, 74, "    ", StatColour%
  823.         END IF
  824.         IF Mouse% THEN
  825.            MouseNow leftButton%, rightButton%, xMouse%, yMouse%
  826.            IF leftButton% THEN
  827.               IF yMouse% > 15 AND yMouse% < 24 THEN
  828.                  Z$ = CHR$(32): EXIT DO
  829.               END IF
  830.            END IF
  831.         END IF
  832.         Z$ = INKEY$
  833.     LOOP UNTIL Z$ = CHR$(27)
  834.     Frame Head$, 0
  835.     IF Mouse% THEN
  836.        CALL MouseHide: IF Z$ <> CHR$(27) THEN GOTO D002
  837.     END IF
  838. GOTO D400
  839.  
  840. '   Keyboard typeahead buffer.
  841. '
  842. D430:
  843.     COLOR 7, 0: Panel 4, 1, 21, 80, 1, 14
  844.     RESTORE KeyBuff: READ Items%
  845.     FOR I% = 1 TO Items%
  846.         READ Row%, Col%, Me$: LOCATE Row%, Col%, 0: PRINT Me$;
  847.     NEXT I%
  848.     LOCATE 11, 68: COLOR 11
  849.     Start% = &H400 + FarPeek%(&H40, &H80)
  850.     Finish% = &H400 + FarPeek%(&H40, &H82)
  851.     PRINT RIGHT$("0000" + HEX$(Start%), 4); " ";
  852.     PRINT RIGHT$("0000" + HEX$(Finish%), 4);
  853.     DO
  854.         Hd% = &H400 + FarPeek%(&H40, &H1A)
  855.         Tl% = &H400 + FarPeek%(&H40, &H1C)
  856.         LOCATE 11, 4: COLOR 11
  857.         PRINT RIGHT$("0000" + HEX$(Hd%), 4); " ";
  858.         PRINT RIGHT$("0000" + HEX$(Tl%), 4);
  859.         COLOR 13: LOCATE 9, 17: PRINT SPACE$(48);
  860.         LOCATE 9, 17 + ((Hd% - &H41E) \ 2) * 3: PRINT CHR$(25);
  861.         COLOR 12: LOCATE 13, 17: PRINT SPACE$(48);
  862.         LOCATE 13, 17 + ((Tl% - &H41E) \ 2) * 3: PRINT CHR$(24);
  863.         FOR I% = 0 TO 15
  864.             C% = FarPeek%(&H40, &H1E + (I% * 2))
  865.             S% = FarPeek%(&H40, &H1E + (I% * 2) + 1)
  866.             IF C% < 32 THEN Ky$ = "  " ELSE Ky$ = CHR$(C%) + " "
  867.             LOCATE 11, 17 + (I% * 3): COLOR 14: PRINT Ky$;
  868.             LOCATE 14, 17 + (I% * 3): COLOR 9
  869.             PRINT RIGHT$("0" + HEX$(C%), 2);
  870.             LOCATE 15, 17 + (I% * 3): COLOR 10
  871.             PRINT RIGHT$("0" + HEX$(S%), 2);
  872.         NEXT I%
  873.         IF Hd% >= Tl% THEN
  874.            Kys% = 16 - ((Hd% - Tl%) \ 2)
  875.         ELSE
  876.            Kys% = (Tl% - Hd%) \ 2
  877.         END IF
  878.         LOCATE 14, 76: IF Kys% = 16 THEN Kys% = 0
  879.         PRINT RIGHT$(" " + LTRIM$(RTRIM$(STR$(Kys%))), 2);
  880.         IF Kys% = 15 THEN
  881.            LOCATE 15, 67: COLOR 28: PRINT "BUFFER FULL";
  882.            SLEEP 2: KeyFlush: LOCATE , 67: PRINT SPACE$(11);
  883.         END IF
  884.     LOOP UNTIL FarPeek%(&H40, (Tl% - &H400) - 2) = 27
  885.     COLOR 7, 0: LOCATE 20, 1, 0
  886.     Dummy$ = INPUT$(Kys%)
  887. GOTO D400
  888.  
  889. '   Report mouse cursor position and status.
  890. '
  891. D440:
  892.     IF Mouse% THEN
  893.        Panel 4, 1, 21, 80, 1, TextColour%
  894.        CALL MouseShow
  895.        DO
  896.           MouseNow leftButton%, rightButton%, xMouse%, yMouse%
  897.           Me$ = "x=" + LTRIM$(RTRIM$(STR$(xMouse%))) + "  "
  898.           FastPrint 12, 31, Me$, TextColour%
  899.           Me$ = "y=" + LTRIM$(RTRIM$(STR$(yMouse%))) + "  "
  900.           FastPrint 12, 41, Me$, TextColour%
  901.           IF leftButton% THEN
  902.              IF yMouse% > 15 AND yMouse% < 24 THEN
  903.                 EXIT DO
  904.              ELSE
  905.                 Me$ = "Left button pressed"
  906.              END IF
  907.           ELSE
  908.              Me$ = "                   "
  909.           END IF
  910.           FastPrint 14, 31, Me$, TextColour%
  911.           IF rightButton% THEN
  912.              Me$ = "Right button pressed"
  913.           ELSE
  914.              Me$ = "                    "
  915.           END IF
  916.           FastPrint 15, 31, Me$, TextColour%: Z$ = INKEY$
  917.        LOOP UNTIL Z$ = CHR$(27)
  918.        CALL MouseHide
  919.        IF Z$ <> CHR$(27) THEN GOTO D002
  920.     ELSE
  921.        MisTake 9, "Mouse driver not installed", 0, Mouse%
  922.     END IF
  923. GOTO D400
  924.  
  925. '┌────────────────────────────────────────────────────────────────────────┐
  926. '│      Memory-related functions and procedures.                          │
  927. '└────────────────────────────────────────────────────────────────────────┘
  928. '
  929. D500:
  930.     IF EmsPresent% THEN Menu$(0) = "F#E" ELSE Menu$(0) = "F# "
  931.     Menu$(1) = "Operating system &Flags"
  932.     Menu$(3) = "&Expanded memory services"
  933.     Abort% = FALSE
  934.     VerMenu 4, 26, BarColour%, 1, 3, "MEMORY", Menu$(),_
  935.             Choice%, Nxt%, Bar%, 1, RootName$, Mouse%
  936.     IF Nxt% THEN GOTO D002
  937.     SELECT CASE Choice%
  938.         CASE 1
  939.              GOTO D510
  940.         CASE 3
  941.              GOTO D520
  942.         CASE ELSE
  943.     END SELECT
  944. GOTO D002
  945.  
  946. '┌────────────────────────────────────────────────────────────────────────┐
  947. '│      System Flags.                                                     │
  948. '└────────────────────────────────────────────────────────────────────────┘
  949. '
  950. D510:
  951.     DIM CoOrd%(16, 2): Context% = 1: Topic$ = "FLAGS"
  952.     Panel 4, 1, 21, 80, 1, TextColour%: RESTORE Flags
  953.     FOR I% = 6 TO 21
  954.         READ Me$: FastPrint I%, 6, Me$, TextColour%
  955.     NEXT I%
  956.     Panel 6, 50, 16, 27, 2, 48
  957.     FastPrint 7, 53, "CURRENT FLAG SETTINGS", 48
  958.     FastPrint 8, 50, "╟" + STRING$(25, "─") + "╢", 48
  959.     FOR I% = 10 TO 17
  960.         READ Me$: FastPrint I%, 52, Me$, 48
  961.     NEXT I%
  962.     FOR I% = 1 TO 16
  963.         READ CoOrd%(I%, 1), CoOrd%(I%, 2): F% = GetFlag%(I%)
  964.         F$ = LTRIM$(RTRIM$(STR$(F%))): F$ = RIGHT$("   " + F$, 3)
  965.         FastPrint CoOrd%(I%, 1), CoOrd%(I%, 2), F$, 48
  966.     NEXT I%
  967.     FastPrint 19, 52, "Enter Flag Number:", 48
  968.     FastPrint 25, 3, SPACE$(78), StatColour%
  969.     FastPrint 25, 3, "Press <ESC> to Abort", StatColour%
  970.     DO
  971.        LOCATE 19, 73: HotKey% = FALSE
  972.        Number$ = RevInput$(2, Number$, Nu$, 1, "REVINPUT", 0, HotKey%)
  973.        IF HotKey% THEN
  974.           Abort% = TRUE
  975.        ELSE   
  976.           Number% = VAL(Number$)
  977.           IF Number% < 1 OR Number% > 16 THEN
  978.              BEEP
  979.           ELSE
  980.              Number$ = LTRIM$(RTRIM$(STR$(Number%)))
  981.              Number$ = RIGHT$("  " + Number$, 2)
  982.              FastPrint 19, 73, Number$, 48
  983.              Setting% = GetFlag%(Number%)
  984.              Setting$ = RIGHT$("   " + LTRIM$(RTRIM$(STR$(Setting%))), 3)
  985.              LOCATE CoOrd%(Number%, 1), CoOrd%(Number%, 2)
  986.              Setting$ = RevInput$(3, Setting$, Nu$, 1, "REVINPUT", 0, HotKey%)
  987.              IF HotKey% THEN
  988.                 Abort% = TRUE
  989.              ELSE   
  990.                 Setting% = VAL(Setting$)
  991.                 IF Setting% < 0 OR Setting% > 255 THEN
  992.                    BEEP
  993.                 ELSE
  994.                    SetFlag Number%, Setting%
  995.                 END IF
  996.                 Setting% = GetFlag%(Number%)
  997.                 Setting$ = RIGHT$("   " + LTRIM$(RTRIM$(STR$(Setting%))), 3)
  998.                 FastPrint CoOrd%(Number%, 1), CoOrd%(Number%, 2), Setting$, 48
  999.              END IF
  1000.           END IF
  1001.        END IF
  1002.     LOOP UNTIL Abort%
  1003.     ERASE CoOrd%: Frame Head$, 0
  1004. GOTO D500
  1005.  
  1006. '┌────────────────────────────────────────────────────────────────────────┐
  1007. '│      Expanded Memory services.                                         │
  1008. '└────────────────────────────────────────────────────────────────────────┘
  1009. '
  1010. D520:
  1011.     Panel 4, 1, 21, 80, 1, TextColour%: Handle% = FALSE
  1012.     FastPrint 6, 23, "┌─────────────────────────────────┐", TextColour%
  1013.     FastPrint 7, 23, "│  EXPANDED MEMORY DEMONSTRATION  │", TextColour%
  1014.     FastPrint 8, 23, "└─────────────────────────────────┘", TextColour%
  1015.     Version% = EmsVersion%: PageFrame% = EmsFrame%
  1016.     EmsTotal% = EmsPages%(0): EmsFree% = EmsPages%(1)
  1017.     LIM$ = LTRIM$(RTRIM$(STR$(Version%))): L% = LEN(LIM$)
  1018.     IF L% > 1 THEN LIM$ = LEFT$(LIM$, L% - 1) + "." + RIGHT$(LIM$, 1)
  1019.     Me$ = "You have" + STR$(EmsTotal% * 16) + " KiloBytes of LIM "_
  1020.         + LIM$ + " Expanded Memory installed."
  1021.     FastPrint 10, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1022.     Me$ = "The Page Frame segment is at address " + HEX$(PageFrame%) + " Hex,"
  1023.     FastPrint 11, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1024.     Me$ = "and there are" + STR$(EmsFree%) + " pages ("_
  1025.         + LTRIM$(RTRIM$(STR$(EmsFree% * 16))) + "KB) free."
  1026.     FastPrint 12, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1027.     IF EmsFree% < 4 THEN
  1028.        Me$ = "Sorry, that's not enough for this demonstration."
  1029.        FastPrint 15, 40 - (LEN(Me$) \ 2), Me$, TextColour%: GOTO D525
  1030.     END IF
  1031.     SLEEP 1: KeyFlush: Me$ = "Requesting four pages for this demonstration,"
  1032.     FastPrint 14, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1033.     EmsRequest 4, Handle%: IF Handle% = 0 THEN GOTO D529
  1034.     Pages% = EmsOwned%(Handle%): IF Pages% < 4 THEN GOTO D529
  1035.     Me$ = "they have been assigned to Handle" + STR$(Handle%) + "."
  1036.     FastPrint 15, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1037.     Me$ = "Saving this screen to page 1": SLEEP 1: KeyFlush
  1038.     FastPrint 17, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1039.     IF Colour% THEN Segment% = &HB800 ELSE Segment% = &HB000
  1040.     SLEEP 1: KeyFlush: Me$ = "Drawing and saving three other screens ...."
  1041.     FastPrint 17, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1042.     EmsPut Segment%, 0, 4000, 1, Handle%, Done%
  1043.     IF NOT Done% THEN GOTO D529
  1044.     SLEEP 1: KeyFlush: FastPrint 25, 1, SPACE$(80), StatColour%
  1045.     Page% = 2: Row% = 11: Col% = 35
  1046.     RESTORE Numbers
  1047.     DO
  1048.         READ Columns%, BackGround%: IF NOT Colour% THEN BackGround% = 0
  1049.         Attr% = Attribute%(15, BackGround%)
  1050.         BackFill 4, 1, 21, 80, Attr%
  1051.         Scroll 1, 9, 2, 23, 79, 0, Attr%
  1052.         FastPrint 10, 36, "P A G E", Attr%
  1053.         FOR I% = 1 TO Columns%
  1054.             READ Item$: IF Item$ = "F" THEN Item$ = "12345678"
  1055.             FOR J% = 1 TO LEN(Item$)
  1056.                 Rows% = VAL(MID$(Item$, J%, 1))
  1057.                 FastPrint Row% + Rows%, Col% + I%, CHR$(219), Attr%
  1058.             NEXT J%
  1059.         NEXT I%
  1060.         EmsPut Segment%, 0, 4000, Page%, Handle%, Done%
  1061.         Page% = Page% + 1: IF NOT Done% THEN EXIT DO
  1062.         SLEEP 1: KeyFlush
  1063.     LOOP UNTIL Page% > 4
  1064.     IF NOT Done% THEN GOTO D529
  1065.     EmsGet Segment%, 0, 4000, 1, Handle%, Done%
  1066.     IF NOT Done% THEN GOTO D529
  1067.     Me$ = "Now I'll let YOU bring 'em back again ...."
  1068.     FastPrint 19, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1069.     FastPrint 22, 24, "Press a key when you're ready >", TextColour%
  1070.     LOCATE 22, 56, 1: Page% = 4: IF KeyIn% = 27 THEN GOTO D525
  1071.     DO
  1072.        EmsGet Segment%, 0, 4000, Page%, Handle%, Done%
  1073.        IF NOT Done% THEN EXIT DO
  1074.        FastPrint 25, 63, "Press a key >", StatColour%
  1075.        LOCATE 25, 77: KeyPress% = KeyIn%
  1076.        Page% = Page% - 1
  1077.     LOOP WHILE Page% > 1
  1078.     IF Done% THEN EmsGet Segment%, 0, 4000, 1, Handle%, Done%
  1079.     LOCATE , , 0: IF NOT Done% THEN GOTO D529
  1080.     Me$ = "The demonstration was completely successful, which proves that"
  1081.     FastPrint 17, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1082.     Me$ = "your Expanded Memory is in good working order."
  1083.     FastPrint 18, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1084. D525:
  1085.     IF Handle% THEN
  1086.        SLEEP 1: KeyFlush: EmsRelease Handle%
  1087.        Me$ = "We released all pages assigned to handle" + STR$(Handle%)_
  1088.            + " before finishing,"
  1089.        FastPrint 20, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1090.        Me$ = "otherwise no other program would have been able to use them."
  1091.        FastPrint 21, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1092.     END IF
  1093.     SLEEP 2: KeyFlush
  1094. GOTO D500
  1095.  
  1096. D529:
  1097.     Me$ = "An EMM error" + STR$(EmsError%) + " has just occurred ..."
  1098.     MisTake 12, Me$, 0, Mouse%
  1099. GOTO D525
  1100.  
  1101. '┌────────────────────────────────────────────────────────────────────────┐
  1102. '│      Miscellaneous functions and procedures.                           │
  1103. '└────────────────────────────────────────────────────────────────────────┘
  1104. '
  1105. D600:
  1106.     Menu$(0) = "DHEFP"
  1107.     Menu$(1) = "&Date entry and validation"
  1108.     Menu$(2) = "&Hardware equipment list"
  1109.     Menu$(3) = "&Encryption of text"
  1110.     Menu$(4) = "&Fast string sorting"
  1111.     Menu$(5) = "&Pathname for help files"
  1112.     Abort% = FALSE
  1113.     VerMenu 4, 34, BarColour%, 1, 5, "EXAMPLES", Menu$(),_
  1114.             Choice%, Nxt%, Bar%, 1, RootName$, Mouse%
  1115.     IF Nxt% THEN GOTO D002
  1116.     SELECT CASE Choice%
  1117.         CASE 1
  1118.              GOTO D610
  1119.         CASE 2
  1120.              GOTO D620
  1121.         CASE 3
  1122.              GOTO D630
  1123.         CASE 4
  1124.              GOTO D640
  1125.         CASE 5
  1126.              GOTO D650
  1127.         CASE ELSE
  1128.     END SELECT
  1129. GOTO D002
  1130.  
  1131. '┌────────────────────────────────────────────────────────────────────────┐
  1132. '│      Long Date Routine.                                                │
  1133. '└────────────────────────────────────────────────────────────────────────┘
  1134. '
  1135. D610:
  1136.     IF Colour% THEN Attrib% = 48 ELSE Attrib% = 112
  1137.     HotKey% = FALSE: IF ToDay$ = "" THEN ToDay$ = SPACE$(20)
  1138.     Context% = 1: Topic$ = "LONGDATE": WW% = LEN(ToDay$)
  1139.     WT% = 41 - (WW% \ 2): PopUp 8, 24, 8, 34, Attrib%, 3, 2, -1
  1140.     FastPrint 9, 33, "Today's date is:", Attrib%
  1141.     FastPrint 10, WT%, ToDay$, Attrib%
  1142.     Ok% = Verify%(1, 12, "Is this correct", 0, Mouse%)
  1143.     IF NOT Ok% THEN
  1144.        FastPrint 12, 32, "Enter correct date", Attrib%
  1145.        Temp$ = "": LOCATE 14, 37
  1146.        Temp$ = DateInput$(Temp$, 1, "DATINPUT", HotKey%)
  1147.        IF HotKey% THEN
  1148.           Abort% = TRUE
  1149.        ELSE   
  1150.           Now$ = Temp$: MO% = VAL(MID$(Temp$, 4, 2))
  1151.           DY% = VAL(LEFT$(Temp$, 2)): YR% = VAL(RIGHT$(Temp$, 2))
  1152.           ToDay$ = LongDate$(DY%, MO%, YR%): OL% = LEN(ToDay$)
  1153.           IF OL% > 0 THEN
  1154.              FastPrint 25, 41, SPACE$(40), StatColour%
  1155.              FastPrint 25, 79 - OL%, ToDay$, StatColour%
  1156.           END IF
  1157.        END IF
  1158.     END IF
  1159.     ShutUp -1
  1160. GOTO D600
  1161.  
  1162. '┌────────────────────────────────────────────────────────────────────────┐
  1163. '│      Equipment List.                                                   │
  1164. '└────────────────────────────────────────────────────────────────────────┘
  1165. '
  1166. D620:
  1167.     Panel 4, 1, 21, 80, 1, TextColour%
  1168.     Cols$ = "80": Video$ = "colour": REDIM Model(0 TO 8) AS STRING
  1169.     RESTORE HWare: FOR I% = 0 TO 8: READ Model(I%): NEXT
  1170.     Equipment% = PeekWord&(&H40, &H10): Flag$ = STRING$(16, "0")
  1171.     Computer% = FarPeek%(&HF000, &HFFFE)
  1172.     Computer% = Computer% - &HF8: IF Computer% < 0 THEN Computer% = 0
  1173.     FastPrint 8, 38, "IBM " + Model(Computer%) + " or compatible", TextColour%
  1174.     Chip% = Cpu%: CoPro% = MathsChip%
  1175.     SELECT CASE Chip%
  1176.         CASE IS < 0
  1177.              Me$ = " an Intel 80C" + LTRIM$(RTRIM$(STR$(ABS(Chip%))))
  1178.         CASE 20, 30
  1179.              Me$ = " a NEC V" + LTRIM$(RTRIM$(STR$(Chip%)))
  1180.         CASE 88 TO 486
  1181.              Me$ = " an Intel 80" + LTRIM$(RTRIM$(STR$(Chip%)))
  1182.         CASE ELSE
  1183.              Me$ = " an unknown"
  1184.     END SELECT
  1185.     Me$ = "with" + Me$ + " microprocessor"
  1186.     FastPrint 9, 38, Me$, TextColour%
  1187.     FOR I% = 15 TO 0 STEP -1
  1188.         IF BitTest%(Equipment%, I%) THEN
  1189.            MID$(Flag$, 16 - I%, 1) = "1"
  1190.         END IF
  1191.     NEXT I%
  1192.     FastPrint 8, 3, " F E D C B A 9 8 7 6 5 4 3 2 1 0", TextColour%
  1193.     FastPrint 9, 3, "┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐", TextColour%
  1194.     FastPrint 10, 3, "│", TextColour%: Col% = 4
  1195.     FOR I% = 1 TO 16
  1196.         FastPrint 10, Col%, MID$(Flag$, I%, 1) + "│", TextColour%
  1197.         Col% = Col% + 2
  1198.     NEXT I%
  1199.     FastPrint 10, 38, "ROM BIOS Equipment Flag at 0040:0010", TextColour%
  1200.     FastPrint 11, 3, "└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘", TextColour%
  1201.     FastPrint 12, 3, " │ │   │ │ │ │   │ │ │ │ │ │ │ │", TextColour%
  1202.     FastPrint 13, 3, " │ │   │ │ │ │   │ │ │ │ │ │ │ └─", TextColour%
  1203.     FastPrint 14, 3, " │ │   │ │ │ │   │ │ │ │ │ │ └───", TextColour%
  1204.     FastPrint 15, 3, " │ │   │ │ │ │   │ │ │ │ └─┴─────", TextColour%
  1205.     FastPrint 16, 3, " │ │   │ │ │ │   │ │ └─┴─────────", TextColour%
  1206.     FastPrint 17, 3, " │ │   │ │ │ │   └─┴─────────────", TextColour%
  1207.     FastPrint 18, 3, " │ │   │ └─┴─┴───────────────────", TextColour%
  1208.     FastPrint 19, 3, " │ │   └─────────────────────────", TextColour%
  1209.     FastPrint 20, 3, " └─┴─────────────────────────────", TextColour%
  1210.     FastPrint 13, 38, "Floppy drives installed?", TextColour%
  1211.     IF MID$(Flag$, 16, 1) = "1" THEN Me$ = "Yes" ELSE Me$ = "No"
  1212.     FastPrint 13, 68, Me$, TextColour%
  1213.     FastPrint 14, 38, "Maths coprocessor installed?", TextColour%
  1214.     IF MID$(Flag$, 15, 1) = "1" THEN Me$ = "Yes" ELSE Me$ = "No"
  1215.     IF CoPro% > 0 THEN Me$ = "80" + LTRIM$(RTRIM$(STR$(CoPro%)))
  1216.     FastPrint 14, 68, Me$, TextColour%
  1217.     FastPrint 15, 38, "Original PC motherboard RAM", TextColour%
  1218.     IF Computer% = 1 THEN
  1219.        Ram% = (BinDec&(MID$(Flag$, 13, 2)) + 1) * 16
  1220.        Me$ = RIGHT$("  " + LTRIM$(RTRIM$(STR$(Ram%))), 2) + "KB"
  1221.     ELSE
  1222.        Me$ = "n/a"
  1223.     END IF
  1224.     FastPrint 15, 68, Me$, TextColour%
  1225.     FastPrint 16, 38, "Initial Video mode", TextColour%
  1226.     Mode% = BinDec&(MID$(Flag$, 11, 2))
  1227.     IF Mode% = 1 THEN Cols$ = "40"
  1228.     IF Mode% = 7 THEN Video$ = "mono"
  1229.     FastPrint 16, 58, Cols$ + " column " + Video$, TextColour%
  1230.     FastPrint 17, 38, "Number of floppy drives", TextColour%
  1231.     Mode% = BinDec&(MID$(Flag$, 9, 2)) + 1
  1232.     Me$ = LTRIM$(RTRIM$(STR$(Mode%))): FastPrint 17, 68, Me$, TextColour%
  1233.     FastPrint 18, 38, "Number of serial ports", TextColour%
  1234.     Mode% = BinDec&(MID$(Flag$, 5, 3)) + 1
  1235.     Me$ = LTRIM$(RTRIM$(STR$(Mode%))): FastPrint 18, 68, Me$, TextColour%
  1236.     FastPrint 19, 38, "Games adaptor installed?", TextColour%
  1237.     IF MID$(Flag$, 3, 1) = "1" THEN Me$ = "Yes" ELSE Me$ = "No"
  1238.     FastPrint 19, 68, Me$, TextColour%
  1239.     FastPrint 20, 38, "Number of parallel printers", TextColour%
  1240.     Mode% = BinDec&(LEFT$(Flag$, 2))
  1241.     Me$ = LTRIM$(RTRIM$(STR$(Mode%))): FastPrint 20, 68, Me$, TextColour%
  1242.     FastPrint 25, 1, SPACE$(80), StatColour%
  1243.     FastPrint 25, 3, "Press a key to continue", StatColour%
  1244.     IF Mouse% THEN MouseShow
  1245.     DO
  1246.        IF Mouse% THEN
  1247.           MouseNow leftButton%, rightButton%, xMouse%, yMouse%
  1248.           IF leftButton% THEN
  1249.              IF yMouse% > 15 AND yMouse% < 24 THEN
  1250.                 Z$ = "": EXIT DO
  1251.              END IF
  1252.           END IF
  1253.        END IF
  1254.        Z$ = INKEY$
  1255.     LOOP WHILE Z$ = ""
  1256.     Frame Head$, 0: ERASE Model
  1257.     IF Mouse% THEN
  1258.        CALL MouseHide: IF Z$ = "" THEN GOTO D002
  1259.     END IF
  1260. GOTO D600
  1261.  
  1262. '   Text Encryption.
  1263. '
  1264. D630:
  1265.     Panel 4, 1, 21, 80, 1, TextColour%
  1266.     Done% = FALSE: Abort% = FALSE: HotKey% = FALSE
  1267.     Text$ = "": Code$ = ""
  1268.     RESTORE Crypt
  1269.     FOR I% = 1 TO 5
  1270.         READ Me$: FastPrint 6 + I%, 11, Me$, TextColour%
  1271.     NEXT I%
  1272.     IF Colour% THEN Attrib% = 32 ELSE Attrib% = 112
  1273.     DO WHILE Text$ = ""
  1274.        PopUp 17, 19, 4, 44, Attrib%, 2, 2, -1
  1275.        FastPrint 18, 27, "Enter string to be encrypted", Attrib%
  1276.        LOCATE 19, 21
  1277.        Text$ = RevInput$(40, "", "", 1, "REVINPUT", -1, HotKey%)
  1278.        ShutUp -1: IF HotKey% THEN Abort% = TRUE: EXIT DO
  1279.        Text$ = LTRIM$(RTRIM$(Text$))
  1280.        IF Text$ = "" THEN
  1281.           MisTake 9, "You can't encrypt an empty string!", 0, Mouse%
  1282.        END IF
  1283.     LOOP
  1284.     IF NOT Abort% THEN
  1285.        IF Colour% THEN Attrib% = 78 ELSE Attrib% = 112
  1286.        DO WHILE Code$ = ""
  1287.           PopUp 17, 19, 4, 44, Attrib%, 2, 2, -1
  1288.           FastPrint 18, 25, "Enter string to encrypt it with", Attrib%
  1289.           LOCATE 19, 21 
  1290.           Code$ = RevInput$(40, "", "", 1, "REVINPUT", -1, HotKey%)
  1291.           ShutUp -1: IF HotKey% THEN Abort% = TRUE: EXIT DO
  1292.           Code$ = LTRIM$(RTRIM$(Code$))
  1293.           IF Code$ = "" THEN
  1294.              MisTake 12, "An empty string is no use!", 0, Mouse%
  1295.           END IF
  1296.        LOOP
  1297.        IF NOT Abort% THEN
  1298.           Cipher Text$, Code$: Me$ = "Encrypted string >  " + Text$
  1299.           FastPrint 14, 11, Me$, TextColour%
  1300.           IF Colour% THEN Attrib% = 48 ELSE Attrib% = 112
  1301.           DO
  1302.              DO
  1303.                 PopUp 19, 19, 4, 44, Attrib%, 2, 2, -1
  1304.                 FastPrint 20, 27, "Enter key string once again", Attrib%
  1305.                 LOCATE 21, 21
  1306.                 DeCode$ = RevInput$(40, "", "", 1, "REVINPUT", -1, HotKey%)
  1307.                 ShutUp -1: IF HotKey% THEN Abort% = TRUE: EXIT DO
  1308.                 DeCode$ = LTRIM$(RTRIM$(DeCode$))
  1309.                 IF DeCode$ = "" THEN
  1310.                    MisTake 12, "An empty string is no use!", 0, Mouse%
  1311.                 END IF
  1312.              LOOP WHILE DeCode$ = ""
  1313.              IF Abort% THEN
  1314.                 Done% = TRUE
  1315.              ELSE
  1316.                 Me$ = Text$: Cipher Me$, DeCode$
  1317.                 Me$ = "Decrypted string >  " + Me$
  1318.                 FastPrint 16, 11, Me$, TextColour%
  1319.                 IF Code$ = DeCode$ THEN
  1320.                    FastPrint 19, 33, "That's the one!", TextColour%
  1321.                    Done% = TRUE
  1322.                 ELSE
  1323.                    Me$ = "Whoops, that's not right"
  1324.                    IF MisMatch% THEN
  1325.                       Me$ = Me$ + " either"
  1326.                    END IF
  1327.                    MisTake 9, Me$ + "!", 0, Mouse%
  1328.                    MisMatch% = TRUE
  1329.                 END IF
  1330.              END IF
  1331.           LOOP UNTIL Done%
  1332.        END IF
  1333.     END IF
  1334. GOTO D600
  1335.  
  1336. '   Demonstrate string array sorting and scan routines.
  1337. '
  1338. D640:
  1339.     Room% = TRUE: Me$ = "Not enough memory for sort array"
  1340.     ON ERROR GOTO D645
  1341.     REDIM Array(1 TO 1000) AS STRING
  1342.     ON ERROR GOTO Trap
  1343.     IF NOT Room% THEN GOTO D600
  1344.     RESTORE Strings: IF Colour% THEN COLOR 0, 7
  1345.     Panel 4, 1, 21, 80, 1, TextColour%
  1346.     FOR Row% = 6 TO 7
  1347.         READ Me$: LOCATE Row%, 3: PRINT Me$
  1348.     NEXT Row%
  1349.     FOR I% = 1 TO 1000
  1350.         FOR J% = 1 TO Rand%(5, 11)
  1351.             Array(I%) = Array(I%) + CHR$(Rand%(0, 25) + 65)
  1352.         NEXT J%
  1353.     NEXT I%
  1354.     LOCATE 7, 50: PRINT "done!"
  1355.     LOCATE 9, 3: PRINT "Unsorted array"
  1356.     FOR I% = 1 TO 3
  1357.         Me$ = "Element " + RIGHT$("    " + LTRIM$(RTRIM$(STR$(I%))), 4)
  1358.         LOCATE 10 + I%, 3: PRINT Me$; " "; Array(I%)
  1359.     NEXT I%
  1360.     LOCATE 14, 3: PRINT "  .": Row% = 15
  1361.     FOR I% = 998 TO 1000
  1362.         Me$ = "Element " + RIGHT$("    " + LTRIM$(RTRIM$(STR$(I%))), 4)
  1363.         LOCATE Row%, 3: PRINT Me$; " "; Array(I%): Row% = Row% + 1
  1364.     NEXT I%
  1365.     PopUp 19, 13, 5, 53, BarColour%, 4, 4, 0
  1366.     READ Me$: FastPrint 21, 15, Me$, BarColour%
  1367.     LOCATE 21, 62: Legal$ = "AaDd"
  1368.     A$ = UCASE$(RevInput$(1, "A", Legal$, 1, "REVINPUT", 0, HotKey%))
  1369.     ShutUp 0: IF Colour% THEN COLOR 0, 7
  1370.     IF HotKey% THEN Abort% = TRUE: GOTO D642
  1371.     IF A$ = "D" THEN
  1372.        Direction% = 1: A$ = "descending"
  1373.     ELSE
  1374.        Direction% = 0: A$ = "ascending"
  1375.     END IF
  1376.     LOCATE 19, 3: PRINT "Sorting the array into "; A$; " order ....";
  1377.     First% = LBOUND(Array): Last% = UBOUND(Array)
  1378.     X! = TIMER
  1379.     StringSort Direction%, 1000, VARPTR(Array(First%))
  1380.     Y! = TIMER
  1381.     PRINT " done!": LOCATE 9, 41: PRINT "Sorted array"
  1382.     FOR I% = 1 TO 3
  1383.         Me$ = "Element " + RIGHT$("    " + LTRIM$(RTRIM$(STR$(I%))), 4)
  1384.         LOCATE 10 + I%, 41: PRINT Me$; " "; Array(I%)
  1385.     NEXT I%
  1386.     LOCATE 14, 41: PRINT "  .": Row% = 15
  1387.     FOR I% = 998 TO 1000
  1388.         Me$ = "Element " + RIGHT$("    " + LTRIM$(RTRIM$(STR$(I%))), 4)
  1389.         LOCATE Row%, 41: PRINT Me$; " "; Array(I%): Row% = Row% + 1
  1390.     NEXT I%
  1391.     LOCATE 20, 3: PRINT USING "The sort took ###.### seconds"; Y! - X!
  1392.     Ok% = Verify%(1, 16, "Search array", 0, Mouse%): IF NOT Ok% THEN GOTO D642
  1393. D641:
  1394.     PopUp 12, 17, 8, 46, BarColour%, 3, 4, -1: HotKey% = 0
  1395.     FastPrint 14, 20, "Enter a string to insert into the array", BarColour%
  1396.     LOCATE 15, 30: A$ = RevInput$(20, "", "", 1, "REVINPUT", 0, HotKey%)
  1397.     IF HotKey% THEN Abort% = TRUE: ShutUp -1: GOTO D642
  1398.     A$ = LTRIM$(RTRIM$(A$))
  1399.     Me$ = "Enter element to insert it into (1-"_
  1400.         + LTRIM$(RTRIM$(STR$(Last%))) + ") "
  1401.     FastPrint 16, 40 - (LEN(Me$) \ 2), Me$, BarColour%
  1402.     LOCATE 17, 38: Temp$ = RevInput$(4, "", Nu$, 1, "REVINPUT", 0, HotKey%)
  1403.     ShutUp -1: IF Colour% THEN COLOR 0, 7
  1404.     IF HotKey% THEN
  1405.        Abort% = TRUE: GOTO D642
  1406.     ELSE
  1407.        S% = VAL(Temp$)
  1408.        IF S% < First% OR S% > Last% THEN
  1409.           MisTake 9, "OUT OF RANGE!", 0, Mouse%
  1410.           GOTO D641
  1411.        ELSE
  1412.           Array(S%) = A$
  1413.           IF S% < 4 THEN
  1414.              LOCATE 10 + S%, 54: PRINT SPACE$(12);
  1415.              LOCATE 10 + S%, 54: PRINT A$;
  1416.           ELSEIF S% > 997 THEN
  1417.              LOCATE S% - 983, 54: PRINT SPACE$(12);
  1418.              LOCATE S% - 983, 54: PRINT A$;
  1419.           END IF
  1420.        END IF
  1421.     END IF
  1422.     LOCATE 21, 3: PRINT "Scanning array for " + A$ + " .... ";
  1423.     X! = TIMER
  1424.     Match% = StringScan%(A$, 1000, First%, VARPTR(Array$(First%)))
  1425.     Y! = TIMER
  1426.     PRINT "found it at element"; Match%
  1427.     LOCATE 22, 3: PRINT USING "The search took ###.### seconds"; Y! - X!
  1428. D642:
  1429.     ERASE Array: IF Colour% THEN COLOR 7, 0
  1430. GOTO D002
  1431.  
  1432. D645:
  1433.     MisTake 9, Me$, 0, Mouse%
  1434.     Room% = FALSE
  1435. RESUME NEXT
  1436.  
  1437. '   Set the environment directory path for Helpmate topic files.
  1438. '
  1439. D650:
  1440.     Panel 4, 1, 21, 80, 1, TextColour%
  1441.     Row% = 5: RESTORE Path
  1442.     FOR I% = 0 TO 12
  1443.         READ Me$: FastPrint Row% + I%, 14, Me$, TextColour%
  1444.     NEXT I%
  1445.     HelPath$ = ENVIRON$("HELP"): Temp$ = HelPath$
  1446.     PopUp 19, 11, 5, 57, Attribute%(14, 6), 3, 4, 0
  1447.     READ Me$: FastPrint 20, 20, Me$, Attribute%(14, 6)
  1448.     READ Me$: FastPrint 22, 14, Me$, Attribute%(14, 6)
  1449.     LOCATE 21, 14: Legal$ = Uc$ + Lc$ + Nu$ + VFln$
  1450.     Temp$ = RevInput$(51, Temp$, Legal$, 1, "REVINPUT", 0, HotKey%)
  1451.     ShutUp 0
  1452.     IF HotKey% THEN
  1453.        Abort% = TRUE
  1454.     ELSE
  1455.        Me$ = "Environment table full"
  1456.        HelPath$ = "HELP=" + LTRIM$(RTRIM$(Temp$))
  1457.        ON ERROR GOTO D645
  1458.        ENVIRON HelPath$
  1459.        ON ERROR GOTO Trap
  1460.     END IF
  1461. GOTO D600
  1462.  
  1463. '┌────────────────────────────────────────────────────────────────────────┐
  1464. '│      Graphics examples.                                                │
  1465. '└────────────────────────────────────────────────────────────────────────┘
  1466. '
  1467. D700:
  1468.     VideoMode Colour%, MaxRes%, VideoRam%
  1469.     IF MaxRes% > 8 THEN
  1470.        Menu$(0) = "CP#SR"
  1471.     ELSEIF MaxRes% AND MaxRes% <> 3 THEN
  1472.        Menu$(0) = "C #  "
  1473.     ELSE
  1474.        Menu$(0) = "  #  "
  1475.     END IF
  1476.     Menu$(1) = "Graphics &characters"
  1477.     Menu$(2) = "Video &panning"
  1478.     Menu$(4) = "&Save screen to file"
  1479.     Menu$(5) = "&Restore screen"
  1480.     VerMenu 4, 47, BarColour%, 1, 5, "GRAPHICS", Menu$(),_
  1481.             Choice%, Nxt%, Bar%, 1, RootName$, Mouse%
  1482.     IF Nxt% THEN GOTO D002
  1483.     SELECT CASE Choice%
  1484.         CASE 1
  1485.              GOTO D710
  1486.         CASE 2
  1487.              GOTO D720
  1488.         CASE 4, 5
  1489.              GOTO D730
  1490.         CASE ELSE
  1491.     END SELECT
  1492. GOTO D002
  1493.  
  1494. '┌────────────────────────────────────────────────────────────────────────┐
  1495. '│      Graphics characters.                                              │
  1496. '└────────────────────────────────────────────────────────────────────────┘
  1497. '
  1498. D710:
  1499.     SELECT CASE MaxRes%
  1500.         CASE 2                                  ' Colour Graphics Adaptor
  1501.              Mode = 1
  1502.              SCREEN 1                           ' 320 x 200   4-colour
  1503.         CASE 9                                  ' Enhanced Graphics Adaptor
  1504.              Mode = 2
  1505.              SCREEN 7                           ' 320 x 200  16-colour
  1506.         CASE 13
  1507.              IF VideoRam% > 64 THEN
  1508.                 Mode = 3                        ' Video Graphics Array
  1509.              ELSE
  1510.                 Mode = 4                        ' Multicolour Graphics Array
  1511.              END IF
  1512.              SCREEN 13                          ' 320 x 200 256-colour
  1513.         CASE ELSE
  1514.              MisTake 9, "Incompatible Video Card!", 0, Mouse%
  1515.              GOTO D002
  1516.     END SELECT
  1517.  
  1518.     REDIM Hue(1 TO 4) AS INTEGER
  1519.     PLAY "mft240o3l8d#fgl8b-p8l8gl2b-"          ' Hoop-la!
  1520.     RESTORE Title
  1521.     PLAY "mbl8t255o3bo4cdo3bo4co3abgaf#t120gbt200dp8"
  1522.     FOR I% = 1 TO 4: READ Hue(I%): NEXT
  1523.     READ Count%, X1%, Y1%, X2%, Y2%
  1524.     LINE (X1%, Y1%)-(X2%, Y2%), Hue(Mode)
  1525.     FOR I% = 1 TO Count%
  1526.         READ X%, Y%: LINE -(X%, Y%), Hue(Mode)
  1527.     NEXT I%
  1528.     LINE (0, 165)-(259, 165), Hue(Mode)
  1529.     IF Mode = 1 THEN
  1530.        Road$ = CHR$(&H22) + CHR$(11) + CHR$(&H88) + CHR$(44)
  1531.        Tree$ = CHR$(&H11) + CHR$(&H88) + CHR$(&H44) + CHR$(&H22)
  1532.        PAINT (5, 5), 2, Hue(Mode)
  1533.        PAINT (310, 100), 1, Hue(Mode)
  1534.        PAINT (250, 163), Road$, Hue(Mode)
  1535.        PAINT (10, 100), 1, Hue(Mode)
  1536.        LINE (0, 165)-(319, 165), 0
  1537.     ELSE
  1538.        PAINT (5, 5), 9, Hue(Mode)
  1539.        PAINT (310, 100), Hue(Mode), Hue(Mode)
  1540.        PAINT (250, 163), 8, Hue(Mode)
  1541.        PAINT (10, 100), Hue(Mode), Hue(Mode)
  1542.        LINE (0, 165)-(319, 165), 0
  1543.     END IF
  1544.     PSET (57, 113), Hue(Mode)
  1545.     FOR I% = 1 TO 4: READ Hue(I%): NEXT
  1546.     READ Count%, X1%, Y1%, X2%, Y2%
  1547.     LINE (X1%, Y1%)-(X2%, Y2%), Hue(Mode)
  1548.     FOR I% = 1 TO Count%
  1549.         READ X%, Y%: LINE -(X%, Y%), Hue(Mode)
  1550.     NEXT I%
  1551.     CIRCLE (127, 109), 45, Hue(Mode), 1.4, 3.1, .3
  1552.     CIRCLE (166, 102), 35, Hue(Mode), 1, 2.8, .43
  1553.     CIRCLE (214, 95), 32, Hue(Mode), 1.1, 2.8, .39
  1554.     CIRCLE (259, 94), 38, Hue(Mode), .7, 2.6, .48
  1555.     CIRCLE (296, 96), 33, Hue(Mode), .1, 1.8, .45
  1556.     IF Mode = 1 THEN
  1557.        PAINT (215, 90), Tree$, Hue(Mode)
  1558.     ELSE
  1559.        PAINT (215, 90), Hue(Mode), Hue(Mode)
  1560.     END IF
  1561.     PSET (83, 108), Hue(Mode)
  1562.     FOR I% = 1 TO 4: READ Hue(I%): NEXT
  1563.     READ Count%, X1%, Y1%, X2%, Y2%
  1564.     LINE (X1%, Y1%)-(X2%, Y2%), Hue(Mode)
  1565.     FOR I% = 1 TO Count%
  1566.         READ X%, Y%: LINE -(X%, Y%), Hue(Mode)
  1567.     NEXT I%
  1568.     LINE (270, 72)-(276, 86), Hue(Mode), BF
  1569.     PAINT (260, 95), Hue(Mode), Hue(Mode)
  1570.     IF Mode = 1 THEN
  1571.        LINE (215, 86)-(260, 73), 0: LINE -(305, 86), 0
  1572.        LINE (226, 88)-(246, 93), 1, BF: LINE (274, 88)-(294, 93), 1, BF
  1573.        LINE (255, 88)-(265, 98), 2, BF: LINE (271, 70)-(272, 71), 0, BF
  1574.        LINE (274, 70)-(275, 71), 0, BF
  1575.     ELSE
  1576.        LINE (215, 86)-(260, 73), 4: LINE -(305, 86), 4
  1577.        LINE (226, 88)-(246, 93), 26, BF: LINE (274, 88)-(294, 93), 26, BF
  1578.        LINE (255, 88)-(265, 98), 6, BF: LINE (271, 70)-(272, 71), 6, BF
  1579.        LINE (274, 70)-(275, 71), 6, BF: LINE (319, 98)-(220, 98), 8
  1580.        LINE -(186, 99), 8: LINE -(159, 101), 8: LINE -(210, 100), 8
  1581.        LINE -(319, 100), 8: PAINT (300, 99), 8, 8
  1582.     END IF
  1583.     PLAY "t255o4cdecdo3bo4co3abgt120f#at200dp8"
  1584.     FOR I% = 1 TO 4: READ Hue(I%): NEXT
  1585.     LINE (320, 102)-(285, 102), Hue(Mode)
  1586.     CIRCLE (292, 102), 6, Hue(Mode), .8, 3.1415, .7
  1587.     CIRCLE (302, 102), 9, Hue(Mode), .8, 2.5, .75
  1588.     CIRCLE (318, 102), 16, Hue(Mode), .6, 2.7, .85
  1589.     IF Mode = 1 THEN
  1590.        LINE (320, 94)-(307, 93), 1
  1591.        PAINT (310, 95), Tree$, Hue(Mode), CHR$(&HAA)
  1592.        GraPrint 256, 78, "A", GrAttrib%(0, 3), 1
  1593.        LINE (76, 6)-(244, 32), 3, BF: LINE (76, 32)-(244, 52), 1, BF
  1594.     ELSE
  1595.        PAINT (310, 100), Hue(Mode), Hue(Mode)
  1596.        GraPrint 256, 78, "A", GrAttrib%(27, -1), 1
  1597.        LINE (76, 6)-(244, 32), 14, BF: LINE (76, 32)-(244, 52), 15, BF
  1598.     END IF
  1599.     Me$ = "GRAPHICS": I% = 1: X% = 80: Y% = 9
  1600.     IF Mode = 1 THEN
  1601.        Clr% = GrAttrib%(0, 3): Box% = 0
  1602.     ELSE
  1603.        Clr% = GrAttrib%(1, -1): Box% = 1
  1604.     END IF
  1605.     DO
  1606.         LINE (X%, Y%)-(X% + 20, Y% + 20), Box%, B
  1607.         GraPrint X% + 3, Y% + 3, MID$(Me$, I%, 1), Clr%, 2
  1608.         I% = I% + 1: X% = X% + 20
  1609.     LOOP UNTIL I% > 8
  1610.     Me$ = "CHARACTERS": I% = 1: X% = 78: Y% = 32
  1611.     IF Mode = 1 THEN
  1612.        Clr% = GrAttrib%(2, 1)
  1613.     ELSE
  1614.        Clr% = GrAttrib%(7, -1)
  1615.     END IF
  1616.     DO
  1617.         GraPrint X% + 5, Y% + 3, MID$(Me$, I%, 1), Clr%, 2
  1618.         I% = I% + 1: X% = X% + 16
  1619.     LOOP UNTIL I% > 10
  1620.     IF Mode = 1 THEN
  1621.        LINE (5, 60)-(175, 145), 0, BF: LINE (4, 59)-(176, 146), 3, B
  1622.     END IF
  1623.     I% = 1: READ Count%
  1624.     DO
  1625.         READ X%, Y%, Me$, Fore%, Back%, Scale%
  1626.         GraPrint X%, Y%, Me$, GrAttrib%(Fore%, Back%), Scale%
  1627.         I% = I% + 1
  1628.     LOOP UNTIL I% > Count%
  1629.     PLAY "mft255ef#gdef#gef#g#aef#g#ag#abo4co3bo4cdeco3af#gdgbt120g"
  1630.     I% = 1: READ Count%
  1631.     DO
  1632.         READ X%, Y%, Me$, Fore%, Back%, Scale%
  1633.         GraPrint X%, Y%, Me$, GrAttrib%(Fore%, Back%), Scale%
  1634.         I% = I% + 1
  1635.     LOOP UNTIL I% > Count%
  1636.     DO: LOOP UNTIL KeyIn% = 32
  1637.     SCREEN 0: WIDTH 80
  1638. GOTO D001    
  1639.  
  1640. '┌────────────────────────────────────────────────────────────────────────┐
  1641. '│      Video Panning.                                                    │
  1642. '└────────────────────────────────────────────────────────────────────────┘
  1643. '
  1644. D720:
  1645.     IF (MaxRes% = 13 AND VideoRam% > 64) OR MaxRes% > 9 THEN
  1646.        SCREEN 9: LINE (0, 0)-(639, 349), 9, BF
  1647.        VIEW SCREEN (40, 25)-(600, 325), 0, 15
  1648.        CIRCLE (319, 174), 150, 14: PAINT (319, 174), 14, 14
  1649.        X% = 0: Y% = 0
  1650.        DO
  1651.           KeyPress% = KeyIn%: Pan% = TRUE
  1652.           SELECT CASE KeyPress%
  1653.               CASE -75
  1654.                    IF X% > 0 THEN X% = X% - 1
  1655.               CASE -77
  1656.                    IF X% < 79 THEN X% = X% + 1
  1657.               CASE -72
  1658.                    IF Y% > 0 THEN Y% = Y% - 1
  1659.               CASE -80
  1660.                    IF Y% < 22 THEN Y% = Y% + 1
  1661.               CASE ELSE
  1662.                    Pan% = FALSE
  1663.           END SELECT
  1664.           IF Pan% THEN VGAPan X%, Y% * 5
  1665.        LOOP UNTIL KeyPress% = 27
  1666.        SCREEN 0: WIDTH 80
  1667.     ELSE
  1668.        MisTake 9, "Incompatible Video Card!", 0, Mouse%
  1669.     END IF
  1670. GOTO D001    
  1671.  
  1672. '┌────────────────────────────────────────────────────────────────────────┐
  1673. '│      Video Save and Restore.                                           │
  1674. '└────────────────────────────────────────────────────────────────────────┘
  1675. '
  1676. D730:
  1677.     SELECT CASE MaxRes%
  1678.         CASE 7
  1679.              xMax% = 319: yMax% = 199: FileSize& = 32000
  1680.         CASE 8
  1681.              xMax% = 639: yMax% = 199: FileSize& = 64000
  1682.         CASE 9, 10
  1683.              xMax% = 639: yMax% = 349: FileSize& = 112000
  1684.         CASE 11, 12
  1685.              xMax% = 639: yMax% = 479: FileSize& = 153600
  1686.         CASE 13
  1687.              IF VideoRam% > 64 THEN
  1688.                 xMax% = 639: yMax% = 479: FileSize& = 153600
  1689.                 MaxRes% = 12
  1690.              ELSE
  1691.                 xMax% = 319: yMax% = 199: FileSize& = 64000
  1692.              END IF                     
  1693.         CASE ELSE
  1694.              MisTake 9, "Incompatible Video Card!", 0, Mouse%
  1695.              GOTO D002
  1696.     END SELECT
  1697.     IF Choice% = 4 THEN    
  1698.        IF FreeSpace&(0) > FileSize& THEN
  1699.           SCREEN MaxRes%: RESTORE Escher
  1700.           LINE (0, 0)-(xMax%, yMax%), 6, BF
  1701.           VIEW (32, 4)-(xMax% - 32, yMax% - 4), 0, 5
  1702.           WINDOW SCREEN (0, 0)-(255, 191)
  1703.           FOR I% = 1 TO 40
  1704.               READ A%, B%, C%, D%: LINE (A%, B%)-(C%, D%), 1
  1705.           NEXT I%
  1706.           PAINT (56, 20), 1, 1: PAINT (136, 64), 1, 1
  1707.           PAINT (120, 80), 1, 1: PAINT (192, 88), 14, 1
  1708.           PAINT (76, 48), 14, 1: PAINT (124, 60), 14, 1
  1709.           PAINT (68, 12), 2, 1: PAINT (80, 84), 2, 1
  1710.           PAINT (92, 128), 2, 1: PAINT (36, 156), 12, 1
  1711.           PAINT (36, 168), 1, 1: PAINT (84, 178), 14, 1
  1712.           PAINT (88, 118), 12, 1: PAINT (144, 86), 12, 1
  1713.           VGASave "ESCHER.IMG": KeyPress% = KeyIn%
  1714.        ELSE
  1715.           MisTake 9, "Insufficient disk space!", 0, Mouse%
  1716.        END IF
  1717.     ELSE   
  1718.        IF SizeOf&("ESCHER.IMG") > 0 THEN
  1719.           SCREEN MaxRes%
  1720.           VGALoad "ESCHER.IMG"
  1721.           KeyPress% = KeyIn%
  1722.        ELSE   
  1723.           MisTake 9, "Screen Image file not found!", 0, Mouse%
  1724.        END IF 
  1725.     END IF
  1726.     SCREEN 0: WIDTH 80
  1727. GOTO D001    
  1728.  
  1729. '┌────────────────────────────────────────────────────────────────────────┐
  1730. '│      Program Exit.                                                     │
  1731. '└────────────────────────────────────────────────────────────────────────┘
  1732. '
  1733. D800:
  1734.     Menu$(0) = "E#D"
  1735.     Menu$(1) = "&Exit program"
  1736.     Menu$(3) = "&DOS shell"
  1737.     VerMenu 4, 59, BarColour%, 1, 3, "EXIT", Menu$(),_
  1738.             Choice%, Nxt%, Bar%, 1, RootName$, Mouse%
  1739.     IF Nxt% THEN GOTO D002
  1740.     SELECT CASE Choice%
  1741.         CASE 1
  1742.              GOTO D810
  1743.         CASE 3
  1744.              GOTO D820
  1745.         CASE ELSE
  1746.     END SELECT
  1747. GOTO D002
  1748.  
  1749. '   Program Exit
  1750. '
  1751. D810:
  1752.     IF Colour% THEN
  1753.        Scroll 1, 1, 1, 25, 80, 0, Attribute%(15, 1)
  1754.        COLOR , , 1: Attrib% = 32
  1755.     ELSE
  1756.        FOR I% = 1 TO 24
  1757.            FastPrint I%, 1, STRING$(80, "░"), 7
  1758.        NEXT I%
  1759.        Attrib% = 112
  1760.     END IF
  1761.     PopUp 3, 2, 9, 44, Attrib%, 3, 2, -1: RESTORE Credits
  1762.     FOR I% = 4 TO 9
  1763.         READ Me$: FastPrint I%, 4, Me$, Attrib%
  1764.     NEXT I%    
  1765.     SLEEP 5: KeyFlush
  1766.     IF Colour% THEN Attrib% = 48 ELSE Attrib% = 112
  1767.     PopUp 10, 29, 11, 50, Attrib%, 2, 1, -1
  1768.     FOR I% = 11 TO 19
  1769.         READ Me$: FastPrint I%, 31, Me$, Attrib%
  1770.     NEXT I%
  1771.     SLEEP 10: ShutUp -1: SLEEP 1: ShutUp -1: SLEEP 1
  1772.     CALL KeyFlush: CLS
  1773. GOTO Egress
  1774.  
  1775. '┌────────────────────────────────────────────────────────────────────────┐
  1776. '│      Operating System Shell.                                           │
  1777. '└────────────────────────────────────────────────────────────────────────┘
  1778. '
  1779. D820:
  1780.     Scroll 1, 3, 1, 25, 80, 0, 7
  1781.     Me$ = "Enter the command 'EXIT' when you are ready to return."
  1782.     FastPrint 10, 40 - (LEN(Me$) \ 2), Me$, 14
  1783.     LOCATE 13, 1, 1: ON ERROR GOTO D821
  1784.     SHELL
  1785.     ON ERROR GOTO Trap
  1786.     GOTO D001
  1787. D821:
  1788.     ON ERROR GOTO Trap
  1789.     IF ERR = 5 THEN
  1790.        MisTake 9, "Cannot load secondary Command Processor", 0, Mouse%
  1791.        RESUME D800
  1792.     END IF
  1793.  
  1794. '┌────────────────────────────────────────────────────────────────────────┐
  1795. '│      Error Trap.                                                       │
  1796. '└────────────────────────────────────────────────────────────────────────┘
  1797. '
  1798. Trap:
  1799.     Fatal% = TRUE
  1800.     SELECT CASE ERR
  1801.         CASE 7, 14
  1802.              Me$ = "Out of memory"
  1803.         CASE 27
  1804.              Me$ = "PRINTER NOT READY": Fatal% = FALSE
  1805.         CASE 61, 67
  1806.              Me$ = "Out of disk space"
  1807.         CASE 71
  1808.              Me$ = "DISK DRIVE NOT READY": Fatal% = FALSE
  1809.         CASE 72
  1810.              Me$ = "Disk media error"
  1811.         CASE ELSE
  1812.              A$ = STR$(ERR): Me$ = "A type" + A$ + " Error has just occurred"
  1813.     END SELECT
  1814.     IF Fatal% THEN
  1815.        Me$ = Me$ + ", aborting to DOS ..."
  1816.        SL% = StatusLine%(Me$)
  1817.        RESUME Egress
  1818.     ELSE
  1819.        ML% = LEN(Me$): MT% = 40 - (ML% \ 2)
  1820.        IF Colour% THEN Attrib% = 78 ELSE Attrib% = 112
  1821.        PopUp 9, 20, 7, 42, Attrib%, 3, 2, -1
  1822.        FastPrint 10, MT%, Me$, Attrib% + 128: BEEP
  1823.        Me$ = "Please correct this error if possible"
  1824.        FastPrint 12, 22, Me$, Attrib%
  1825.        FastPrint 13, 30, "Press a key when ready", Attrib%
  1826.        FastPrint 14, 32, "or <ESC> to Abort.", Attrib%
  1827.        Character% = KeyIn%: ShutUp -1
  1828.        IF Character% = 27 THEN RESUME Egress
  1829.        RESUME
  1830.     END IF
  1831. Egress:
  1832.     Attr% = SCREEN(20, 1, 1)
  1833.     Curtains 25, 255: Curtains 25, 31: Curtains 25, Attr%
  1834.     LOCATE 20, 1, 1: ClearEnd 1, Attr%
  1835. END
  1836.  
  1837. '┌────────────────────────────────────────────────────────────────────────┐
  1838. '│     Program specific functions and procedures.                         │
  1839. '└────────────────────────────────────────────────────────────────────────┘
  1840. '
  1841. '   Draws or refreshes the main display screen. If switch is zero, only the
  1842. '   status line is refreshed.
  1843. '
  1844. SUB Frame (Title$, Switch%) STATIC
  1845.     SHARED StatColour%, HeadColour%, TextColour%, ToDay$
  1846.     IF Switch% THEN
  1847.        Scroll 1, 1, 1, 3, 80, 0, HeadColour%
  1848.        IF Title$ <> "" THEN
  1849.           FastPrint 1, 40 - (LEN(Title$) \ 2), Title$, HeadColour%
  1850.        END IF
  1851.        FastPrint 2, 1, STRING$(80, "─"), HeadColour%
  1852.        Panel 4, 1, 21, 80, 1, TextColour%
  1853.     END IF
  1854.     FastPrint 25, 1, SPACE$(80), StatColour%
  1855.     FastPrint 25, 4, "Press <F1> for Help, <ESC> to Abort", StatColour%
  1856.     IF ToDay$ <> "" THEN
  1857.        FastPrint 25, 78 - LEN(ToDay$), ToDay$, StatColour%
  1858.     END IF
  1859. END SUB
  1860.  
  1861. '┌────────────────────────────────────────────────────────────────────────┐
  1862. '│     Data Division.                                                     │
  1863. '└────────────────────────────────────────────────────────────────────────┘
  1864. '
  1865. Blurb:
  1866.     DATA "The Library modules on this disk provide you"
  1867.     DATA "with all the facilities necessary for you to"
  1868.     DATA "implement a full range of window features in"
  1869.     DATA "your programs.  With just one statement, for"
  1870.     DATA "instance, you can 'Pop-up' a window onto the"
  1871.     DATA "screen."
  1872.     DATA "The window can be a simple rectangle, in any"
  1873.     DATA "the QuickBASIC background colors, such as .."
  1874.     DATA "Alternatively it may have a border in one of"
  1875.     DATA "eight styles ...."
  1876.     DATA "The border itself may be in any one of the"
  1877.     DATA "QuickBASIC foreground colors. It can blink"
  1878.     DATA "if you want it to ..."
  1879.     DATA "The window, too, can be presented in several"
  1880.     DATA "different ways. It can be flat..."
  1881.     DATA "or it can have a black shadow underneath, to"
  1882.     DATA "give a three-dimensional effect..."
  1883.     DATA "Once you have a window on the screen, simply"
  1884.     DATA "use FASTPRINT, also in the TOOLBOX Library, "
  1885.     DATA "to put text into it, in any colour you like."
  1886.     DATA "You can also use the SCROLL routine from the"
  1887.     DATA "same source, to clear the window's contents."
  1888.     DATA "All the functions in the Library are written"
  1889.     DATA "in fast assembly language, but this does not"
  1890.     DATA "prevent them from being very easy to use."
  1891.     DATA "This for instance, is the call to create the"
  1892.     DATA "present window ....."
  1893.     DATA "   PopUp 8, 14, 8, 52, 112, 2, 0, -1"
  1894.     DATA "Before opening a window, the function stores"
  1895.     DATA "the screen beneath it in an internal buffer."
  1896.     DATA "When you close a window, the screen contents"
  1897.     DATA "are restored to their original location. Use"
  1898.     DATA "the statement 'ShutUp -1' to close the last"
  1899.     DATA "window opened.  For example ...."
  1900.     DATA "The Library includes several functions which"
  1901.     DATA "apply windowing techniques. The HELP screen,"
  1902.     DATA "which is available at the front menu, is one"
  1903.     DATA "example. Another is the VERIFY BOX which you"
  1904.     DATA "can use to collect a Yes/No response from an"
  1905.     DATA "operator, without redrawing the display."
  1906.     DATA "Another utility is the STATUS LINE MESSAGE,"
  1907.     DATA "which can be used to pause execution of the"
  1908.     DATA "program until the operator presses a key."
  1909.     DATA "You can display any prompt message you like"
  1910.     DATA "and the function will return the ASCII code"
  1911.     DATA "of the key which was pressed."
  1912.     DATA "I often use StatusLine in conjunction with a"
  1913.     DATA "routine which checks if the printer is ready"
  1914.     DATA "or not.  This gives the user a chance to fix"
  1915.     DATA "the printer,  if it is just out of paper, or"
  1916.     DATA "to abandon printing, if it is a more serious"
  1917.     DATA "problem. PrinTest is included here too."
  1918.  
  1919. Flags:
  1920.     DATA "The ASSEMBLY-LANGUAGE TOOLBOX includes a"
  1921.     DATA "pair  of functions which give you access"
  1922.     DATA "to  the  INTRA-APPLICATION COMMUNICATION"
  1923.     DATA "AREA (IAC),  an area of memory which has"
  1924.     DATA "been reserved,  by DOS, so that programs"
  1925.     DATA "can communicate with each other. The IAC"
  1926.     DATA "is 16 bytes long and is located,  in low"
  1927.     DATA "RAM at addresses 0000:04F0 - 04FF (Hex)."
  1928.     DATA "Once set, an IAC flag retains it's value"
  1929.     DATA "until  you reset it,  or the computer is"
  1930.     DATA "rebooted."
  1931.     DATA "Since QuickBASIC programs, compiled with"
  1932.     DATA "the /O switch to run stand-alone, cannot"
  1933.     DATA "pass variables to chain modules, you can"
  1934.     DATA "use  this feature to implement a limited"
  1935.     DATA "form of parameter passing."
  1936.     DATA "1.4F0h       9.4F8h", "2.4F1h      10.4F9h"
  1937.     DATA "3.4F2h      11.4FAh", "4.4F3h      12.4FBh"
  1938.     DATA "5.4F4h      13.4FCh", "6.4F5h      14.4FDh"
  1939.     DATA "7.4F6h      15.4FEh", "8.4F7h      16.4FFh"
  1940.     DATA 10, 59, 11, 59, 12, 59, 13, 59, 14, 59, 15, 59
  1941.     DATA 16, 59, 17, 59, 10, 72, 11, 72, 12, 72, 13, 72
  1942.     DATA 14, 72, 15, 72, 16, 72, 17, 72
  1943.  
  1944. Finder:
  1945.     DATA "This function allows you to find out if a particular"
  1946.     DATA "file is present on any disk drive in the system."," "
  1947.     DATA "Enter the name of the file which you want to locate,"
  1948.     DATA "including the drive letter and directory pathname if"
  1949.     DATA "required.  You can use an ambiguous name,  including"
  1950.     DATA "the wildcard characters (* and ?).  In this case the"
  1951.     DATA "function will pop up a directory window containing a"
  1952.     DATA "list of all files that match. You can select the one"
  1953.     DATA "you are interested in,  by high-lighting it with the"
  1954.     DATA "cursor arrow keys and pressing <RETURN>. The routine"
  1955.     DATA "returns a string containing the full pathname of the"
  1956.     DATA "file which you have selected."
  1957.  
  1958. Sorts:
  1959.     DATA "SORTFILE sorts ASCII text files. You supply the name, which may"
  1960.     DATA "include a directory pathname, and the start position and length"
  1961.     DATA "of the field which the file is to be sorted on.", " "
  1962.     DATA "The program first checks the size of the file and the amount of"
  1963.     DATA "free disk space to see if the it can be sorted in memory, this"
  1964.     DATA "requires space for two copies of the file on disk. If it is too"
  1965.     DATA "large, the file is sorted in place so that no extra disk space"
  1966.     DATA "is required. Using this method, which is far slower, the file"
  1967.     DATA "may be of any size up to 4 Gigabytes."
  1968.  
  1969. Size:
  1970.     DATA "THIS PROGRAM REPORTS THE SIZE OF FILES WHICH YOU SPECIFY"
  1971.     DATA "--------------------------------------------------------", " "
  1972.     DATA "The filename can include a directory path and may be ambiguous,"
  1973.     DATA "using the wildcard characters '*' and '?'. The program will"
  1974.     DATA "return the size of the file, in bytes, or, if more than one"
  1975.     DATA "match is found, the total size of all the files. If a size of"
  1976.     DATA "zero is returned, the file does not exist (at least not in the"
  1977.     DATA "directory specified).", " "
  1978.     DATA "Type in the pathname required (no more than 64 characters) or"
  1979.     DATA "Enter an empty string to quit."
  1980.  
  1981. KeyBuff:
  1982.     DATA 19, 6, 4, "Head Tail", 6, 33, "Keyboard Buffer"
  1983.     DATA  6, 67, "Buffer Area", 8, 4, "041A 041C"
  1984.     DATA  8, 17, "1E 20 22 24 26 28 2A 2C 2E 30 32 34 36 38 3A 3C"
  1985.     DATA  8, 68, "0480 0482", 10, 3, "┌────┬────┐"
  1986.     DATA 10, 16, "┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐"
  1987.     DATA 10, 67, "┌────┬────┐",11, 3,"│         │", 11, 16, "│"
  1988.     DATA 11, 64, "│", 11, 67, "│         │", 12, 3, "└────┴────┘"
  1989.     DATA 12, 16, "└──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘"
  1990.     DATA 12, 67, "└────┴────┘", 14, 3, "ASCII Codes"
  1991.     DATA 14, 67, "Waiting", 15, 3, "Scan Codes"
  1992.  
  1993. HWare:
  1994.     DATA "Unknown computer type", "PC", "PC/XT", "PCjr"
  1995.     DATA "PC/AT, PS/2 Model 50/60", "PC/XT", "PS/2 Model 30"
  1996.     DATA "PC Convertible", "PS/2 Model 80"
  1997.  
  1998. Shift:
  1999.     DATA "Left & Right SHIFT keys pressed", "CTRL key pressed"
  2000.     DATA "ALT key pressed", "SCROLL LOCK active"
  2001.     DATA "NUM LOCK active", "CAPS LOCK active"
  2002.     DATA "INSERT key status", "Left CTRL key pressed"
  2003.     DATA "Left ALT key pressed", "SYS REQ key pressed"
  2004.     DATA "PAUSE (or CTRL-NUM LOCK) active", "SCROLL LOCK pressed"
  2005.     DATA "NUM LOCK pressed", "CAPS LOCK pressed"
  2006.     DATA "INSERT key pressed"
  2007.  
  2008. Numbers:
  2009.     DATA 8, 1, 125678, 125678, 158, 158, 158, 158, 123458, 123458
  2010.     DATA 8, 4, 1278, 1278, 18, 148, 148, 148, F, 1235678
  2011.     DATA 8, 5, 12345, 12345, 5, 5, 45678, 45678, 5, 5
  2012.     DATA 8, 6, 12348, 12348, 148, 148, 148, 148, 145678, 145678
  2013.  
  2014. Crypt:
  2015.     DATA "This routine requires that you supply two strings of
  2016.     DATA "characters. The first is the text to be encrypted, and"
  2017.     DATA "the second is one or more keywords which are used to"
  2018.     DATA "encipher the text. Thereafter, the text cannot be"
  2019.     DATA "decrypted until you supply the same key string again."
  2020.  
  2021. Strings:
  2022.     DATA "Building a 1000 element, variable-length, string array"
  2023.     DATA "in memory and filling it with random data .... "
  2024.     DATA "Sort into Ascending or Descending order (A/D) [ ]"
  2025.  
  2026. Path:
  2027.     DATA "By default, the Toolbox Help system looks for its'"
  2028.     DATA "topic files in a subdirectory called HELP, beneath"
  2029.     DATA "the currently-logged directory.  You can, however,"
  2030.     DATA "direct it to look elsewhere for files by setting a"
  2031.     DATA "HELP variable in the DOS environment table;",""
  2032.     DATA "e.g.  SET HELP=C:\BASIC\TOOLBOX\HELP",""
  2033.     DATA "Alternatively, you can use the QuickBASIC ENVIRON"
  2034.     DATA "statement within your program, to point HELPMATE to"
  2035.     DATA "the appropriate pathname. Remember, 'though, that"
  2036.     DATA "this method only remains in effect as long as the"
  2037.     DATA "current program is running."
  2038.     DATA "The current HELP environment pathname is"
  2039.     DATA "Enter replacement or press <Esc> to leave unchanged"
  2040.  
  2041. Title:
  2042.     DATA 1, 2, 2, 2, 29, 0, 92, 23, 95
  2043.     DATA 64, 98, 104, 101, 135, 103, 102, 106, 65, 112, 30, 115
  2044.     DATA 10, 119, 5, 122, 3, 125, 5, 128, 10, 131, 30, 136, 65, 142
  2045.     DATA 221, 165, 320, 165, 320, 156, 35, 125, 27, 122, 35, 119
  2046.     DATA 65, 112, 102, 106, 135, 103, 149, 102, 162, 101, 195, 98
  2047.     DATA 240, 92, 272, 90, 304, 92, 320, 94
  2048.     DATA 0, 6, 167, 167, 8, 320, 94, 304, 92
  2049.     DATA 272, 90, 240, 92, 195, 98, 162, 101, 149, 102, 135, 103
  2050.     DATA 102, 106, 82, 109
  2051.     DATA 3, 7, 90, 90, 6, 220, 85, 220, 98
  2052.     DATA 300, 98, 300, 86, 305, 86, 260, 73, 215, 86, 220, 86
  2053.     DATA 0, 6, 167, 167
  2054.     DATA 8
  2055.     DATA 15, 65, "Professional Edition", 15, -1, 1
  2056.     DATA 15, 75, "available from...", 15, -1, 1
  2057.     DATA 15, 95, "ARDEN Software Ltd", 15, -1, 1
  2058.     DATA 15, 105, "115/117 Barkby Road", 15, -1, 1
  2059.     DATA 15, 115, "Leicester LE4 7LG", 15, -1, 1
  2060.     DATA 15, 131, "Tel. (0533)-761524", 15, -1, 1
  2061.     DATA 8, 172, "for TOOLBOX support", 14, 0, 2
  2062.     DATA 72, 172, "TOOLBOX", 13, 0, 2
  2063.     DATA 2
  2064.     DATA 39, 192, "Press the SPACE BAR to continue", 11, 0, 1
  2065.     DATA 119, 192, "SPACE BAR", 15, 0, 1
  2066.  
  2067. Escher:
  2068.     DATA 68,4,200,76,52,12,112,44,128,52,172,76,128,52,68,84,112,44,84,60
  2069.     DATA 128,68,99,84,68,36,97,52,128,68,154,84,128,68,128,116,128,52,128
  2070.     DATA 68,68,4,52,12,172,76,142,90,142,76,142,108,142,108,200,76,200,76
  2071.     DATA 200,92,200,92,68,164,128,116,84,140,52,12,52,154,52,154,68,164
  2072.     DATA 68,164,68,100,68,36,68,84,84,45,84,76,84,109,84,140,68,100,97,116
  2073.     DATA 84,124,112,108,68,84,128,116,84,76,112,92,112,77,112,108,84,119
  2074.     DATA 92,114,142,86,151,82,180,66,186,62,186,62,236,90,236,90,68,184
  2075.     DATA 68,184,16,154,16,154,52,133,16,154,16,160,16,160,68,190,68,190
  2076.     DATA 68,184,68,190,236,96,236,96,236,90
  2077.  
  2078. Credits:
  2079.     DATA "   The Assembly-Language Toolbox for   "
  2080.     DATA "          Microsoft QuickBASIC         "
  2081.     DATA "    Professional Edition, Release 5    "
  2082.     DATA "                                       "
  2083.     DATA "is available for QuickBASIC 4.5 and the"
  2084.     DATA "BASIC 7 Professional Development System"
  2085.  
  2086.     DATA "The Professional Edition contains source code,"
  2087.     DATA "object files, stand-alone and Quick libraries"
  2088.     DATA "and a complete set of documentation. To order"
  2089.     DATA "your copy, contact....", ""
  2090.     DATA "Neil Carter:         ARDEN Software Ltd"
  2091.     DATA "                     115/117 Barkby Road"
  2092.     DATA "                     Leicester LE4 7LG"
  2093.     DATA "Tel. (0533)-761524   Fax. (0533)-740249"
  2094.  
  2095. '┌────────────────────────────────────────────────────────────────────────┐
  2096. '│      (c) 1988,1991 By Christy Gemmell and Singular Software.           │
  2097. '└────────────────────────────────────────────────────────────────────────┘
  2098.