Category : BASIC Source Code
Archive   : DNALIB40.ZIP
Filename : YESNO.BAS

 
Output of file : YESNO.BAS contained in archive : DNALIB40.ZIP
DECLARE SUB Popwind(Title$,Toprow%,Leftcolumn%,Bottomrow%,Rightcolumn%,Attr%, Shadow%, Border%)
DECLARE SUB SaveScreen(ScreenID$,TopRow%,LeftColumn%,BottomRow%,RightColumn%,Shadow%)
DECLARE SUB RestoreScreen(ScreenID$,TopRow%,LeftColumn%)
DECLARE SUB CalcByte(Attr%,LowByte%,HiByte%)
DECLARE SUB Clicked(Rgt%,Lft%,Row%,Col%)
DECLARE SUB HideCursor()
DECLARE SUB ShowCursor()
DECLARE FUNCTION LeftButtonReleased%()

FUNCTION YesNo%(Text$,Mouse%,Location%,BAttr%,Attr%,Shadow%,Border%) PUBLIC

CalcByte Attr%,FGround%,BGround%
CalcByte BAttr%,BtFG%,BtBG%
Finished% = 0

IF Mouse% THEN HideCursor

X% = LEN (Text$) AND 1

IF X% = 0 THEN 'see if the string is odd or even
Prompt$ = Text$
ELSE
Prompt$ = Text$ + CHR$(32) 'if it's odd add a space
END IF

IF LEN (Prompt$) <= 16 THEN 'only size the box if the string
Size% = 20 'is less than 16 characters
ELSEIF LEN (Prompt$) >= 16 THEN
Size% = LEN (Prompt$) + 4 'make the box fit the string

END IF


SaveScreen YesNoScreen$,Location%, 40 - (Size% / 2), Location% + 5, 40 + (Size% / 2) - 1, Shadow%

Popwind Title$,Location%, 40 - (Size% / 2), Location% + 5, 40 + (Size% / 2) - 1, Attr%, Shadow%, Border%

COLOR Fground%, Bground%
LOCATE Location% + 1, 40 - LEN (Prompt$) / 2,0
PRINT Prompt$;

Row% = Location% + 3
Col% = 40 - (Size% / 2) + 3

IF Mouse% THEN
COLOR FGround%,BGround%
LOCATE Location%,40 - (Size% / 2) + 2,0
PRINT CHR$(91,254,93);
END IF

DO

COLOR BtFG%,BtBG%
LOCATE Row%, Col%,0
PRINT " YES ";
COLOR 0,BGround%
LOCATE Row%, Col% + 5,0
PRINT "Ü";
COLOR 0,BGround%
LOCATE Row% + 1,Col% + 1,0
PRINT "ßßßßß";

COLOR BtFG%,BtBG%
LOCATE Row%,Col% + 9,0
PRINT " NO ";
COLOR 0,BGround%
LOCATE Row%,Col% + 13,0
PRINT "Ü";
COLOR 0,BGround%
LOCATE Row% + 1,Col% + 10,0
PRINT "ßßßß"

WHILE NOT INSTAT
IF Mouse% THEN
ShowCursor
Rgt% = 0:Lft% = 0
Clicked Rgt%,Lft%,MRow%,MCol%
IF Lft% AND MRow% = Row% THEN
IF LeftButtonReleased% THEN
SELECT CASE MCol%
CASE Col% TO Col% + 5
Chose% = 89
HideCursor
GOTO KeyBoardRoutine
CASE Col% + 9 TO Col% + 13
Chose% = 78
HideCursor
GOTO KeyBoardRoutine
END SELECT
END IF
ELSE
IF Lft% AND MRow% = Location% AND MCol% = 40 - (Size% / 2) + 3 THEN
IF LeftButtonReleased% THEN
Chose% = 27
GOTO KeyBoardRoutine
END IF
END IF
END IF
END IF
WEND
Ky$ = INKEY$


IF LEN(Ky$) = 1 THEN
Chose% = ASC(Ky$)
ELSE
Chose% = -ASC(RIGHT$(Ky$,1))
END IF

KeyBoardRoutine:

SELECT CASE Chose%

CASE 89,121 'Yes
COLOR FGround%,BGround%
LOCATE Row%,Col%,0
PRINT " ";
LOCATE Row% + 1,Col% + 1,0
PRINT " ";
COLOR BtFG%,BtBG%
LOCATE Row%,Col% + 1,0
PRINT " YES "
YesNo% = 1
Finished% = 1

CASE 78,110 'No

COLOR FGround%,BGround%
LOCATE Row%,Col% + 9,0
PRINT " ";
LOCATE Row% + 1,Col% + 10,0
PRINT " ";
COLOR BtFG%,BtBG%
LOCATE Row%,Col% + 10,0
PRINT " NO "
YesNo% = 0
Finished% = 1

CASE 27
YesNo% = 0
Finished% = 1

CASE ELSE
BEEP

END SELECT

LOOP UNTIL Finished%

IF Mouse% THEN ShowCursor
DELAY .5
IF Mouse% THEN HideCursor
RestoreScreen YesNoScreen$,Location%, 40 - (Size% / 2)
END FUNCTION








  3 Responses to “Category : BASIC Source Code
Archive   : DNALIB40.ZIP
Filename : YESNO.BAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. 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/