home *** CD-ROM | disk | FTP | other *** search
- '******************************TEMPFILE.BAS*******************************
- '
- 'A program to create a UNIQUE Temporary file that you can use
- 'to store stuff and KNOW that there is no temp file that
- 'you just destroyed with your TempFile$ = "~TEMP.$$$" variable
- '
- 'Uses INTERRUPT &H21 Function &H5A in AX to MAKE the Temp file then
- 'calls INTERRRUPT &H21 Function &H3E to CLOSE that file as a zero byte
- 'file. Now you have to use OPEN it again to use it.
- '
- 'DS:DX holds the file name so you have to PEEK into a variable
- '
- 'After a temp file is made, I add the Extension *.TMP to it so there is
- 'no question as to what it is
- '
- 'For some reason that I don't really understand, you can't use the
- 'QuickBASIC command NAME to add an Extension, had to SHELL.
- '
- 'John De Palma on CompuServe 76076,571
- '
- 'Tues 03-29-1994 23:45:00
- '
- '
- DEFINT A-Z
- '$INCLUDE: 'qb.bi'
- DECLARE SUB MakeTempFile (TempFile$, NewFile$)
- DECLARE SUB ErrorHandler (ErrorCode%)
- DECLARE SUB EditLine (a$, exitCode%)
- DECLARE SUB LocateIt (Row%, Text$)
- DECLARE SUB Splash (BackGround%)
- DECLARE SUB TextBoxShadow (Row%, Col%, Message$, Outline%, Shadow%, Length%)
- DECLARE SUB TwoColrs (Fgd%, Bkg%, Colr%)
- DECLARE SUB CursorOff ()
- DECLARE SUB ColorIt (Fgd%, Bkg%)
- DECLARE SUB CursorOn ()
- DECLARE SUB SetBorder (ColrByte%)
- DECLARE SUB ErrorBox (Row%)
- DECLARE SUB Squawk (Num%)
- DECLARE SUB WaitKey ()
- DECLARE SUB SplitClearScreen ()
- DECLARE SUB GetColr (Fgd%, Bkg%, Colr%)
- DECLARE SUB StarFlag ()
- DECLARE SUB Pause2 (Seconds!)
-
- DECLARE FUNCTION KeyCode% ()
- DECLARE FUNCTION Center% (Text$)
- DECLARE FUNCTION GetDirectory$ (Drive$)
- DECLARE FUNCTION GetDrive% ()
-
- DIM SHARED Regs AS RegType
- DIM SHARED NewFile$(1 TO 10) 'this stores the files in an array
- DIM SHARED ErrorCode%
-
- Copyright$ = "■Copyright (c) 1994 LearnWare (c) ■ John De Palma■"
-
- CursorOff
- CALL SetBorder(4)
- CALL StarFlag
- Pause2 (2)
- CALL SplitClearScreen
- CALL ColorIt(8, 7)
- CLS
- CALL Splash(0)
-
- CALL ColorIt(15, 4)
-
- Text$ = "Enter a VALID Path to place the files, ie: C:\ "
-
- CALL LocateIt(2, Text$)
- CALL ColorIt(11, 0)
-
- Dir$ = GetDirectory$(Drive$)
- Length% = LEN(Dir$)
- IF Length% < 20 THEN
- Dir$ = Dir$ + SPACE$(20 - Length%)
- END IF
- Message$ = SPACE$(LEN(Dir$))
- CALL TextBoxShadow(4, Col%, Message$, 6, 1, 0)
-
- LOCATE 5, Center(Message$)
- CALL EditLine(Dir$, ErrorCode%)
- Dir$ = RTRIM$(LTRIM$(Dir$))
- CursorOff
-
- CALL ColorIt(14, 1)
-
- LOCATE 10, 8
- PRINT "NewFileName # ArrayFile().TMP"
- LOCATE 11, 8
- PRINT STRING$(55, 205)
- PRINT
- Ext$ = ".TMP"
- FOR i = 1 TO 10
-
- TempFile$ = UCASE$(Dir$)
- CALL MakeTempFile(TempFile$, NewFile$)
- IF ErrorCode% THEN
- CALL ErrorBox(20)
- CALL ErrorHandler(ErrorCode%)
- Squawk (2)
- GOTO CleanUpAndEnd
- END IF
- NewFile$(i) = NewFile$ + Ext$
- 'Next QB command doesn't work have to SHELL to add *.TMP extension
- 'NAME NewFile$ AS NewFile$(i)
- SHELL "rename " + NewFile$ + " " + RIGHT$(NewFile$(i), 12)
-
- LOCATE 12 + i, 8
- PRINT NewFile$; " "; i; " "; NewFile$(i)
- NEXT
- WaitKey
- CALL SetBorder(3)
- CALL StarFlag
- Pause2 (2)
- CALL SplitClearScreen
- CleanUpAndEnd:
-
- SetBorder (0)
- CursorOff
- COLOR 7, 0
- END
-
- FUNCTION Center% (Text$)
- Center% = 41 - LEN(Text$) \ 2
- END FUNCTION
-
- SUB ColorIt (Fgd%, Bkg%)
- COLOR Fgd%, Bkg%
- END SUB
-
- SUB CursorOff
- LOCATE , , 0
- END SUB
-
- SUB CursorOn
- LOCATE , , 1, 4, 7
- END SUB
-
- SUB EditLine (a$, exitCode%) STATIC
-
- ' Set up some variables
- Row% = CSRLIN
- Col% = POS(0)
- Length% = LEN(a$)
- ptr% = 0
- insert% = True
- quit% = False
- original$ = a$
-
- ' Main processing loop
- DO
-
- ' Display the line
- LOCATE Row%, Col%, 0
- PRINT a$;
-
- ' Show appropriate cursor type
- IF insert% THEN
- LOCATE Row%, Col% + ptr%, 1, 6, 7
- ELSE
- LOCATE Row%, Col% + ptr%, 1, 1, 7
- END IF
-
- ' Get next keystroke
- keyNumber% = KeyCode%
-
- ' Process the key
- SELECT CASE keyNumber%
-
- CASE INSERTKEY
- IF insert% THEN
- insert% = False
- ELSE
- insert% = True
- END IF
-
- CASE BACKSPACE
- IF ptr% THEN
- a$ = a$ + " "
- a$ = LEFT$(a$, ptr% - 1) + MID$(a$, ptr% + 1)
- ptr% = ptr% - 1
- END IF
-
- CASE DELETE
- a$ = a$ + " "
- a$ = LEFT$(a$, ptr%) + MID$(a$, ptr% + 2)
-
- CASE UPARROW
- exitCode% = 1
- quit% = True
-
- CASE DOWNARROW
- exitCode% = -1
- quit% = True
-
- CASE LEFTARROW
- IF ptr% THEN
- ptr% = ptr% - 1
- END IF
-
- CASE RIGHTARROW
- IF ptr% < Length% - 1 THEN
- ptr% = ptr% + 1
- END IF
-
- CASE ENTER
- exitCode% = 0
- quit% = True
-
- CASE HOME
- ptr% = 0
-
- CASE ENDKEY
- ptr% = Length% - 1
-
-
- CASE ESCAPE
- a$ = original$
- ptr% = 0
- insert% = True
- exitCode% = -1
- CASE IS > 255
- CALL Squawk(2)
-
- CASE IS < 32
- CALL Squawk(2)
-
- CASE ELSE
-
- ' Convert key code to character string
- kee$ = CHR$(keyNumber%)
-
- ' Insert or overstrike
- IF insert% THEN
- a$ = LEFT$(a$, ptr%) + kee$ + MID$(a$, ptr% + 1)
- a$ = LEFT$(a$, Length%)
- ELSE
- IF ptr% < Length% THEN
- MID$(a$, ptr% + 1, 1) = kee$
- END IF
- END IF
-
- ' Are we up against the wall?
- IF ptr% < Length% THEN
- ptr% = ptr% + 1
- ELSE
- CALL Squawk(2)
- END IF
-
- END SELECT
-
- LOOP UNTIL quit%
-
- END SUB
-
- SUB ErrorBox (Row%)
-
- CALL ColorIt(14, 4)
- OldRow% = CSRLIN
- OldCol% = POS(0)
- Text$ = "█▀▀▀▀▀▀▀▀▀▀▀▀▀█"
- CALL LocateIt(Row%, Text$)
- Text$ = "█ █"
- CALL LocateIt(Row% + 1, Text$)
- Text$ = "█▄▄▄▄▄▄▄▄▄▄▄▄▄█"
- CALL LocateIt(Row% + 2, Text$)
- Text$ = "ERROR"
- CALL ColorIt(15 + 16, 4)
- CALL LocateIt(Row% + 1, Text$)
- LOCATE OldRow%, OldCol%
- END SUB
-
- SUB ErrorHandler (ErrorCode%)
-
- 'This will trap all INTERRUPT &H21 error codes placed in AX
- 'for FUNCTION &H5A and &H3E
- 'Well... actually -all- INTERRUPT &H21 Functions use these error codes
- 'as defined and trapped in the MakeTempFile SUB
- '
- SELECT CASE ErrorCode%
-
- CASE 0
- PRINT "No ERROR FOUND: "; ErrorCode%;
- CASE 2
- PRINT "File Not Found, ERROR # "; ErrorCode%;
- CASE 3
- PRINT "PATH Not FOUND! ERROR # "; ErrorCode%;
- CASE 1, 4 TO 18
- 'are defined, but easier to look up in a book, so...
- PRINT "Undefined Error, Write it Down, ERROR # "; ErrorCode%;
- CASE ELSE
- PRINT "Undefined Error, Write it Down, ERROR # "; ErrorCode%;
- END SELECT
-
- IF ErrorCode% > 0 THEN BEEP
-
- END SUB
-
- SUB GetColr (Fgd%, Bkg%, Colr%) STATIC
-
- Colr% = SCREEN(1, 1, 1)
-
- Fgd% = (Colr% AND 128) \ 8 + (Colr% AND 15)
- Bkg% = (Colr% AND 112) \ 16
-
- END SUB
-
- FUNCTION GetDirectory$ (Drive$) STATIC
- 'DIM Regs AS RegType
-
- IF Drive$ = "" THEN
- d$ = CHR$(GetDrive%)
- ELSE
- d$ = UCASE$(Drive$)
- END IF
-
- Drive% = ASC(d$) - 64
- Regs.dx = Drive%
- Regs.ax = &H4700
- p$ = SPACE$(64)
- Regs.ds = VARSEG(p$)
- Regs.si = SADD(p$)
-
- CALL INTERRUPTX(&H21, Regs, Regs)
-
- p$ = LEFT$(p$, INSTR(p$, CHR$(0)) - 1)
-
- GetDirectory$ = LEFT$(d$, 1) + ":\" + p$
-
- IF Regs.flags AND 1 THEN
- GetDirectory$ = ""
- END IF
-
- END FUNCTION
-
- FUNCTION GetDrive% STATIC
-
- 'DIM Regs AS RegType
- Regs.ax = &H1900
-
- CALL INTERRUPT(&H21, Regs, Regs)
-
- GetDrive% = (Regs.ax AND &HFF) + 65
-
- END FUNCTION
-
- FUNCTION KeyCode% STATIC
-
- DO
- k$ = INKEY$
- LOOP UNTIL k$ <> ""
- KeyCode% = CVI(k$ + CHR$(0))
-
- END FUNCTION
-
- SUB LocateIt (Row%, Text$)
- LOCATE Row%, Center(Text$)
- PRINT Text$;
- END SUB
-
- SUB MakeTempFile (TempFile$, NewFile$) STATIC
-
- 'DIM Regs AS RegType
-
- 'JRD NOTE: Place variable equal to the path where you want the TempFile$
- 'ie: Path$= "C:\WORD\DOC"
- 'TempFile= Path$
- 'if you use a subdirectory that doesn't exist you get no tempfile
- 'MS-DOS requires the following construct for the TempFile$ variable
- TempFile$ = TempFile$ + CHR$(0) + SPACE$(13)
-
- Segment = VARSEG(TempFile$) 'segment where DOS put this file name
- Offset = SADD(TempFile$) 'offset
-
- Regs.ax = &H5A00 'Function to make a temp file
- Regs.cx = 0 'file attribute is none
- Regs.ds = Segment 'data segment gets the file name
- Regs.dx = Offset 'data register gets the offset
-
- CALL INTERRUPTX(&H21, Regs, Regs) 'make a temp file
-
- IF (Regs.flags AND 1) = 1 THEN 'if an error set Carry Flag to one
- NewFile$ = STR$(Regs.ax) 'set file name to the ErrorCode as double check
- ErrorCode% = Regs.ax 'Error Code is in AX
- IF ErrorCode% THEN CALL ErrorHandler(ErrorCode%)
- EXIT SUB
- END IF
-
- Segment = Regs.ds 'redundant
- Offset = Regs.dx 'redundant
-
- Regs.bx = Regs.ax 'the file handle
- Regs.ax = &H3E00
- CALL INTERRUPTX(&H21, Regs, Regs) 'closes the file
-
- IF (Regs.flags AND 1) = 1 THEN 'if an error set Carry Flag to one
- NewFile$ = STR$(Regs.ax) 'set file name to the ErrorCode as double check
- ErrorCode% = Regs.ax 'Error Code is in AX
- IF ErrorCode% THEN CALL ErrorHandler(ErrorCode%)
- EXIT SUB
- END IF
-
- DEF SEG = Segment
-
- i = 0
- NewFile$ = ""
-
- DO
- a$ = CHR$(PEEK(Offset + i))
- IF a$ = CHR$(0) THEN EXIT DO
- i = i + 1
- NewFile$ = NewFile$ + a$
- LOOP
-
- DEF SEG
-
- END SUB
-
- SUB Pause2 (Seconds!)
-
- Synch! = TIMER
- DO 'looping changes the Start! time to
- Start! = TIMER 'synchronize to the system timer
- LOOP WHILE Start! = Synch! 'Seconds! must be SINGLE to get fractions
- 'of a second
- DO
- kee$ = INKEY$
- LOOP UNTIL TIMER > (Start! + Seconds!) OR LEN(kee$)
-
- 'put Kee$ in just in case we pass midnight
- WHILE INKEY$ <> "": WEND 'delete that key stroke
- END SUB
-
- SUB SetBorder (ColrByte%) STATIC
-
- 'DIM Regs AS RegType
- Regs.ax = &H1001
- Regs.bx = ColrByte% * &H100
- CALL INTERRUPT(&H10, Regs, Regs)
-
- END SUB
-
- SUB Splash (BackGround%) STATIC
- STATIC ColrFlag%
- RANDOMIZE TIMER
- IF ColrFlag% OR BackGround% THEN
- UpperBound = 254
- LowerBound = 176
- Char = INT((UpperBound - LowerBound + 1) * RND + LowerBound)
- ELSE
- Char = 176
- END IF
- CLS
- FOR i = 1 TO 25
- LOCATE i, 1
- PRINT STRING$(80, Char);
- NEXT
- ColrFlag% = True
- END SUB
-
- SUB SplitClearScreen
-
- 'DIM Regs AS RegType
- CALL GetColr(Fgd%, Bkg%, Colr%)
-
- 'Initialize counter
- Counter = 25
-
- 'Scroll down
- 'with screen color
- Regs.bx = 256 * Colr%
-
- FOR Index = 0 TO 24
- Regs.ax = &H601
- Regs.cx = 256 * Index
- Regs.dx = (256 * Index) + 39
- CALL INTERRUPT(&H10, Regs, Regs)
- GOSUB DelayIt
-
- 'Scroll up
- 'with screen color
- Counter = Counter - 1
- Regs.ax = &H701
- Regs.cx = (256 * Counter) + 40
- Regs.dx = (256 * Counter) + 79
- CALL INTERRUPT(&H10, Regs, Regs)
- GOSUB DelayIt
- NEXT
-
- COLOR Fgd%, Bkg%
-
- GOTO Around
- DelayIt:
-
- DelayTime! = .001
-
- Start! = TIMER
-
- IF Start! + DelayTime! > 86400 THEN
-
- Finish! = Start! + DelayTime! - 86400
- DO WHILE TIMER >= Start! OR TIMER <= Finish!
- LOOP
-
- ELSE
-
- DO WHILE TIMER <= Start! + DelayTime!
- LOOP
-
- END IF
- 'GOTO Around
- RETURN
- Around:
- END SUB
-
- SUB Squawk (Num%)
- FOR i = 1 TO Num%
- SOUND 1000, 1
- SOUND 1500, 1
- SOUND 500, 1
- NEXT
- END SUB
-
- SUB StarFlag
- COLOR 7, 0
- CLS
- LOCATE 4, 1
- PRINT " "; : COLOR 1, 7: PRINT "█"; : COLOR 15, 1: PRINT "";
- COLOR 1, 7: PRINT "███"; : COLOR 15, 1: PRINT " ";
- COLOR 1, 7: PRINT "█"; : COLOR 15, 1: PRINT "";
- COLOR 1, 7: PRINT "█████"; : COLOR 15, 1: PRINT "";
- COLOR 1, 7: PRINT "█████"; : COLOR 15, 1: PRINT "";
- COLOR 1, 7: PRINT "█████"; : COLOR 15, 1: PRINT "";
- COLOR 1, 7: PRINT "█████"; : COLOR 15, 1: PRINT "";
- COLOR 1, 7: PRINT "████"; : COLOR 4, 7: PRINT "██████████████████████████████████████████";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 1, 7: PRINT "███";
- COLOR 15, 1: PRINT " "; : COLOR 1, 7: PRINT "████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█";
- COLOR 15, 4: PRINT "▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 1, 7: PRINT "█";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█";
- COLOR 15, 1: PRINT " "; : COLOR 1, 7: PRINT "█";
- COLOR 15, 1: PRINT " "; : COLOR 1, 7: PRINT "█";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "████";
- COLOR 15, 7: PRINT "██████████████████████████████████████████";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 1, 7: PRINT "████";
- COLOR 15, 1: PRINT " "; : COLOR 1, 7: PRINT "████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█";
- COLOR 4, 7: PRINT "██████████████████████████████████████████";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 1, 7: PRINT "█";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█";
- COLOR 15, 1: PRINT " "; : COLOR 1, 7: PRINT "█";
- COLOR 15, 1: PRINT " "; : COLOR 1, 7: PRINT "█";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "████";
- COLOR 15, 4: PRINT "▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 1, 7: PRINT "███";
- COLOR 15, 1: PRINT " "; : COLOR 1, 7: PRINT "████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█";
- COLOR 15, 7: PRINT "██████████████████████████████████████████";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 1, 7: PRINT "█";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█";
- COLOR 15, 1: PRINT " "; : COLOR 1, 7: PRINT "█";
- COLOR 15, 1: PRINT " "; : COLOR 1, 7: PRINT "█";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "████";
- COLOR 4, 7: PRINT "██████████████████████████████████████████";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 1, 7: PRINT "███";
- COLOR 15, 1: PRINT " "; : COLOR 1, 7: PRINT "████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█";
- COLOR 15, 4: PRINT "▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 1, 7: PRINT "█";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█";
- COLOR 15, 1: PRINT " "; : COLOR 1, 7: PRINT "█";
- COLOR 15, 1: PRINT " "; : COLOR 1, 7: PRINT "█";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "████";
- COLOR 15, 7: PRINT "██████████████████████████████████████████";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 1, 7: PRINT "████";
- COLOR 15, 1: PRINT " "; : COLOR 1, 7: PRINT "████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█████";
- COLOR 15, 1: PRINT ""; : COLOR 1, 7: PRINT "█";
- COLOR 4, 7: PRINT "██████████████████████████████████████████";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 15, 1: PRINT "▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄";
- COLOR 15, 4: PRINT "▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 15, 7: PRINT "██████████████████████████████████████████████████████████████████████████████";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 4, 7: PRINT "██████████████████████████████████████████████████████████████████████████████";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 15, 4: PRINT "▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 15, 7: PRINT "██████████████████████████████████████████████████████████████████████████████";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 4, 7: PRINT "██████████████████████████████████████████████████████████████████████████████";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 15, 4: PRINT "▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 15, 7: PRINT "██████████████████████████████████████████████████████████████████████████████";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 4, 7: PRINT "██████████████████████████████████████████████████████████████████████████████";
- COLOR 7, 0: PRINT " "; : PRINT " "; : COLOR 4, 0: PRINT "▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ";
-
- END SUB
-
- SUB TextBoxShadow (Row%, Col%, Message$, Outline%, Shadow%, Length%)
- 'Will put a message into a three line box -or-
- 'draw a box without a message using Message$=SPACE$(x)
- 'where "x" is the width of the box and Length%= number of lines > 3
- 'Boxes are centered if Col% = 0; else left side of box = Col%.
- 'Boxes display a true shadow if Shadow% <> 0
- 'True = -1: False = 0
-
- STATIC BoxReadFlag
- Message$ = LEFT$(Message$, 60)
- BoxWidth% = LEN(Message$) + 4
- SELECT CASE Outline%
- CASE 0
- j = 8 * 6 + 1
- CASE 1
- j = 1
- CASE 2
- j = 8 + 1
- CASE 3
- j = 8 * 2 + 1
- CASE 4
- j = 8 * 3 + 1
- CASE 5
- j = 8 * 4 + 1
- CASE 6
- j = 8 * 5 + 1
- CASE ELSE
- j = 8 * 6 + 1
- END SELECT
-
- IF BoxReadFlag THEN GOTO Skip
- REDIM Box$(1 TO 56)
- BoxReadFlag = True
-
- 'single line box
- Box$(1) = "┌"
- Box$(2) = "─"
- Box$(3) = "┐"
- Box$(4) = "│"
- Box$(5) = "│"
- Box$(6) = "└"
- Box$(7) = "─"
- Box$(8) = "┘"
-
- 'double top box
- Box$(9) = "╒"
- Box$(10) = "═"
- Box$(11) = "╕"
- Box$(12) = "│"
- Box$(13) = "│"
- Box$(14) = "╘"
- Box$(15) = "═"
- Box$(16) = "╛"
-
- 'double side box
- Box$(17) = "╓"
- Box$(18) = "─"
- Box$(19) = "╖"
- Box$(20) = "║"
- Box$(21) = "║"
- Box$(22) = "╙"
- Box$(23) = "─"
- Box$(24) = "╜"
-
- 'double box
- Box$(25) = "╔"
- Box$(26) = "═"
- Box$(27) = "╗"
- Box$(28) = "║"
- Box$(29) = "║"
- Box$(30) = "╚"
- Box$(31) = "═"
- Box$(32) = "╝"
-
- 'bold box
- Box$(33) = "█"
- Box$(34) = "▀"
- Box$(35) = "█"
- Box$(36) = "█"
- Box$(37) = "█"
- Box$(38) = "█"
- Box$(39) = "▄"
- Box$(40) = "█"
-
- 'bold and thick box
- Box$(41) = "█"
- Box$(42) = "█"
- Box$(43) = "█"
- Box$(44) = "█"
- Box$(45) = "█"
- Box$(46) = "█"
- Box$(47) = "█"
- Box$(48) = "█"
-
- 'no box
- Box$(49) = " "
- Box$(50) = " "
- Box$(51) = " "
- Box$(52) = " "
- Box$(53) = " "
- Box$(54) = " "
- Box$(55) = " "
- Box$(56) = " "
-
- Skip:
-
- IF Col% = 0 THEN
-
- BoxText$ = Box$(j) + STRING$(BoxWidth%, Box$(j + 1)) + Box$(j + 2)
- CALL LocateIt(Row%, BoxText$)
- Row2% = CSRLIN: Col2% = POS(0)
- Colr% = SCREEN(Row2%, Col2% - 1, 1)
- CALL TwoColrs(Fgd%, Bkg%, Colr%)
-
- FOR i = 1 TO Length% + 1
- BoxText$ = Box$(j + 3) + " " + Message$ + " " + Box$(j + 4)
- CALL LocateIt(Row% + i, BoxText$)
-
- IF Shadow% THEN
- COLOR 7, 0
- FOR k = 1 TO 2
- PRINT CHR$(SCREEN(CSRLIN, POS(0)));
- NEXT
- COLOR Fgd%, Bkg%
- END IF
- NEXT i
-
- BoxText$ = Box$(j + 5) + STRING$(BoxWidth%, Box$(j + 6)) + Box$(j + 7)
- CALL LocateIt(Row% + i, BoxText$)
-
- IF Shadow% THEN
- COLOR 7, 0
- FOR k = 1 TO 2
- PRINT CHR$(SCREEN(CSRLIN, POS(0)));
- NEXT
- 'COLOR Fgd%, Bkg%
-
- COLOR 7, 0
- LOCATE Row% + i + 1, Center(BoxText$) + 2
-
- FOR k = 1 TO BoxWidth% + 2
- PRINT CHR$(SCREEN(CSRLIN, POS(0)));
- NEXT
- COLOR Fgd%, Bkg%
- END IF
- ELSE
-
- BoxText$ = Box$(j) + STRING$(BoxWidth%, Box$(j + 1)) + Box$(j + 2)
- LOCATE Row%, Col%
- PRINT BoxText$;
- Row2% = CSRLIN: Col2% = POS(0)
- Colr% = SCREEN(Row2%, Col2% - 1, 1)
- CALL TwoColrs(Fgd%, Bkg%, Colr%)
-
- FOR i = 1 TO Length% + 1
- BoxText$ = Box$(j + 3) + " " + Message$ + " " + Box$(j + 4)
- LOCATE Row% + i, Col%
- PRINT BoxText$;
-
- IF Shadow% THEN
- COLOR 7, 0
- FOR k = 1 TO 2
- PRINT CHR$(SCREEN(CSRLIN, POS(0)));
- NEXT
- COLOR Fgd%, Bkg%
- END IF
-
- NEXT i
-
- BoxText$ = Box$(j + 5) + STRING$(BoxWidth%, Box$(j + 6)) + Box$(j + 7)
- LOCATE Row% + i, Col%
- PRINT BoxText$;
-
- IF Shadow% THEN
- COLOR 7, 0
- FOR k = 1 TO 2
- PRINT CHR$(SCREEN(CSRLIN, POS(0)));
- NEXT
- 'COLOR Fgd%, Bkg%
- 'COLOR 7,0
- LOCATE Row% + i + 1, Col% + 2
- FOR k = 1 TO BoxWidth% + 2
- PRINT CHR$(SCREEN(CSRLIN, POS(0)));
- NEXT
- COLOR Fgd%, Bkg%
- END IF
-
- END IF
-
- END SUB
-
- SUB TwoColrs (Fgd%, Bkg%, Colr%)
-
- Fgd% = (Colr% AND 128) \ 8 + (Colr% AND 15)
- Bkg% = (Colr% AND 112) \ 16
-
- END SUB
-
- SUB WaitKey
-
- WHILE INKEY$ <> "": WEND
- DO
- kee$ = INKEY$
- LOOP UNTIL LEN(kee$)
- IF kee$ = CHR$(27) THEN END
-
- END SUB
-
-