home *** CD-ROM | disk | FTP | other *** search
- DECLARE FUNCTION Center% (text$)
- '******************************BORDERS2.BAS*********************************
- 'From an idea in Oct/Nov 93 "Inside Microsoft Basic."
- '
- 'BORDERS.COM file made with PDQ and QUICKPAK for small size, this file
- 'made with plain vanilla QuickBASIC. BUT, can NOT be run inside the
- 'DOS. 5.0 QuickBASIC interpreter as it uses CALL INTERRUPT,
- 'you have to have a "real" QuickBASIC interpreter (one you paid hard
- 'cash for).
- '11/17/93
-
- 'One User Defined TYPE for -both- CALL INTERRUPT and CALL INTERRUPTX
- '
- 'The only difference is in the DECLARE, both use RegType as TYPE
- 'Be sure to change "RegTypeX" to "RegType" in the INTERRUPTX call.
- 'August 17, 1993
- '
- TYPE RegType
- AX AS INTEGER
- BX AS INTEGER
- CX AS INTEGER
- DX AS INTEGER
- BP AS INTEGER
- SI AS INTEGER
- DI AS INTEGER
- Flags AS INTEGER
- DS AS INTEGER
- ES AS INTEGER
- END TYPE
-
- ' DECLARE statements for the 2 routines
- ' -------------------------------------
- '
- ' Generate a software interrupt, loading all but the segment registers
- '
- DECLARE SUB INTERRUPT (intNum AS INTEGER, Reg AS RegType, Reg AS RegType)
- '
- ' Generate a software interrupt, loading all registers
- '
- DECLARE SUB INTERRUPTX (intNum AS INTEGER, Reg AS RegType, Reg AS RegType)
- '
-
- REM '$INCLUDE: 'qb.bi' 'don't need this unless you erase the TYPE above
- DEFINT A-Z
- DECLARE SUB SetBorder (ColrByte%)
-
- BeginAgain:
- COLOR 15, 1
- CLS
- COLOR 12, 0
- text2$ = "Set a BORDER Color by Typing the Color Number"
- LOCATE 2, Center(text2$)
- PRINT text2$
-
-
- FOR j = 0 TO 3
- LOCATE 10 + j, 8
- FOR i = 0 TO 15
- COLOR i, 0
- PRINT STRING$(4, 219);
- NEXT
- NEXT
- 'hard to get the numbers to line up because of the space in front
- 'of each number, but got it
- COLOR 15, 1
- LOCATE 10 + j + 1, 7
- FOR n = 0 TO 15
- IF n > 9 THEN
- s = 1
- ELSE
- s = 2
- END IF
- PRINT SPACE$(s); STR$(n);
- NEXT
-
- again:
- text$ = "Type the BORDER Color NUMBER & Press {Enter}"
- LOCATE 4, Center(text$)
- COLOR 15, 1
- PRINT text$;
- Row = CSRLIN
- col = POS(0)
- COLOR 11, 0
- text2$ = "After Selecting a Color Press <Esc> to end or {Enter} to try again"
- LOCATE 22, (80 - LEN(text2$)) / 2
- PRINT text2$;
- LOCATE Row + 2, 39
- COLOR 7, 0
- PRINT SPACE$(2)
- LOCATE Row + 2, 39, 1, 4, 7
- INPUT "", Colr$
- ColrByte% = VAL(Colr$)
- IF ColrByte% > 63 THEN
- BEEP
- GOTO BeginAgain 'I get 63 colors
- END IF
- 'STOP
- LOCATE , , 0
- CALL SetBorder(ColrByte%)
- WHILE INKEY$ <> "" 'clears the keyboard
- WEND
- DO
- KeyHit$ = INKEY$
- LOOP UNTIL LEN(KeyHit$)
- IF KeyHit$ = CHR$(27) THEN
- END
- ELSE
- GOTO again
- END IF
- END
-
- FUNCTION Center (text$)
- Center = 41 - LEN(text$) / 2
- END FUNCTION
-
- SUB SetBorder (ColrByte%) STATIC
- DIM Regs AS RegType
- Regs.AX = &H1001
- Regs.BX = ColrByte% * &H100
- CALL INTERRUPT(&H10, Regs, Regs)
- END SUB
-
-