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