Category : BASIC Source Code
Archive   : BKINPQB.ZIP
Filename : BKEXAMP.BAS
'demonstrates the use of BKInput.LIB
' $INCLUDE: 'BKInput.BI'
' $INCLUDE: 'Colors.BI'
DEFINT A-Z
CONST False% = 0, True% = NOT False
CONST Null$ = ""
' The following accepts new alphanumeric entry in the second row and
' fifth column on the screen with a red background and a cyan foreground.
' Up to 10 characters may be entered. Function keys are not parsed.
CLS
LOCATE 1, 5
COLOR Cyan, Black
PRINT "Alphanumeric - Function keys not parsed"
COLOR Cyan, Red
BKNumeric = False
BKKey = False
BKTemp$ = Null
BKInput 2, 5, 10, BKNumeric, BKKey, BKTemp$
COLOR Cyan, Black
SELECT CASE BKKey%
CASE CR
LOCATE 2, 5
PRINT BKTemp$; SPACE$(10 - LEN(BKTemp$));
LOCATE 2, 20
PRINT "<---- This is what you typed."
CASE Esc
LOCATE 2, 5
PRINT SPACE$(10);
LOCATE 2, 20
PRINT "You hit the ESCape key."
END SELECT
' The following accepts an integer entry in the sixth row and
' fifth column on the screen with a red background and a cyan foreground.
' Up to 6 characters are allowed. Function keys are parsed.
LOCATE 5, 5
PRINT "Numeric - Function keys are parsed"
COLOR Cyan, Red
BKNumeric = True
BKKey = True
BKTemp$ = Null
BKInput 6, 5, 6, BKNumeric, BKKey, BKTemp$
COLOR Cyan, Black
SELECT CASE BKKey%
CASE CR
LOCATE 6, 4
Dummy% = VAL(BKTemp$)
LOCATE 6, 5
PRINT SPACE$(6);
PRINT USING "###,###"; Dummy%;
LOCATE 6, 20
PRINT "<---- This is what you typed."
CASE Esc
LOCATE 6, 5
PRINT SPACE$(10);
LOCATE 6, 20
PRINT "You hit the ESCape key."
CASE F1
LOCATE 6, 5
PRINT SPACE$(6);
LOCATE 6, 20
PRINT "You hit the F1 key."
CASE F2
LOCATE 6, 5
PRINT SPACE$(6);
LOCATE 6, 20
PRINT "You hit the F2 key."
CASE F3
LOCATE 6, 5
PRINT SPACE$(6);
LOCATE 6, 20
PRINT "You hit the F3 key."
CASE F4
LOCATE 6, 5
PRINT SPACE$(6);
LOCATE 6, 20
PRINT "You hit the F4 key."
CASE F5
LOCATE 6, 5
PRINT SPACE$(6);
LOCATE 6, 20
PRINT "You hit the F5 key."
CASE F6
LOCATE 6, 5
PRINT SPACE$(6);
LOCATE 6, 20
PRINT "You hit the F6 key."
CASE F7
LOCATE 6, 5
PRINT SPACE$(6);
LOCATE 6, 20
PRINT "You hit the F7 key."
CASE F8
LOCATE 6, 5
PRINT SPACE$(6);
LOCATE 6, 20
PRINT "You hit the F8 key."
CASE F9
LOCATE 6, 5
PRINT SPACE$(6);
LOCATE 6, 20
PRINT "You hit the F9 key."
CASE F10
LOCATE 6, 5
PRINT SPACE$(6);
LOCATE 6, 20
PRINT "You hit the F10 key."
CASE Tabb
LOCATE 6, 5
PRINT SPACE$(6);
LOCATE 6, 20
PRINT "You hit tab key."
CASE Home
LOCATE 6, 5
PRINT SPACE$(6);
LOCATE 6, 20
PRINT "You hit the HOME key."
CASE Endd
LOCATE 6, 5
PRINT SPACE$(6);
LOCATE 6, 20
PRINT "You hit the END key."
CASE PgUp
LOCATE 6, 5
PRINT SPACE$(6);
LOCATE 6, 20
PRINT "You hit the Page Up key."
CASE PgDn
LOCATE 6, 5
PRINT SPACE$(6);
LOCATE 6, 20
PRINT "You hit the Page Down key."
CASE Up
LOCATE 6, 5
PRINT SPACE$(6);
LOCATE 6, 20
PRINT "You hit the Up Arrow key."
CASE Dn
LOCATE 6, 5
PRINT SPACE$(6);
LOCATE 6, 20
PRINT "You hit the Down key."
END SELECT
' The following accepts an numeric entry in the tenth row and
' fifth column on the screen with a red background and a cyan foreground.
' Up to 10 characters are allowed. Up to 2 decimal places are allowed.
' Function keys are parsed.
LOCATE 9, 5
PRINT "Numeric with 2 decimal places - Function keys not parsed"
COLOR Cyan, Red
BKNumeric = 2
BKKey = False
BKTemp$ = Null
BKInput 10, 5, 10, BKNumeric, BKKey, BKTemp$
COLOR Cyan, Black
SELECT CASE BKKey%
CASE CR
LOCATE 10, 4
Dummy! = VAL(BKTemp$)
LOCATE 10, 5
PRINT SPACE$(10);
LOCATE 10, 5
PRINT USING "#,###,###.##"; Dummy!;
LOCATE 10, 20
PRINT "<---- This is what you typed."
CASE Esc
LOCATE 10, 5
PRINT SPACE$(10);
LOCATE 10, 20
PRINT "You hit the ESCape key."
END SELECT
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/