home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Zodiac Super OZ
/
MEDIADEPOT.ISO
/
FILES
/
13
/
N_B_V203.ZIP
/
YESNO.DMO
< prev
Wrap
Text File
|
1996-07-04
|
3KB
|
69 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME YESNO .DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
$include "DAS-NB01.INC"
$include "DAS-NB02.INC"
$include "DAS-NBT1.INC"
$include "DAS-NBT3.INC"
COLOR 7, 0
CLS
T$ = "fYesNo?( T$, Row?, Col?, Cols?, Answer? )|" +_
"──────────────────────────────────────────────────────────────────"+_
"This function prints the YES and NO boxes in the dialogue box then"+_
"controls the input. You send the pertinent data in a 32byte string"+_
"using YesNoTYPE or a plane string value. If the shadow foreground"+_
"color is > 16 then no shadow is created. If you wish to force your"+_
"users to press <ENTER> then load the keypress members with a value"+_
"of CHR$(0) or some such. If the incoming value of Answer% is above"+_
"ZERO then the function will require an answer. If not, then <ESC>"+_
"will return a value of ZERO if pressed; else 1 will be returned if"+_
"<YES> is indicated and 2 if <NO> is indicated.||" +_
CHR$(9) + "DID YOU UNDERSTAND ALL THIS?"
DIM tYesNo AS YesNoTYPE
tYesNo.YesKey = ASCII( "Y" ) ' UCASEkey is used to test this
tYesNo.YesText = "«Y/es, I did." ' <YES> answer (17 chars max)
tYesNo.YesAttr = 47 ' color attribute for <YES>
tYesNo.NoKey = ASCII( "N" ) ' UCASEkey is used here too
tYesNo.NoText = "╬NOo, I didn't!" ' <NO> answer (17 chars max)
tYesNo.NoAttr = 79 ' color attribute for <NO>
tYesNo.OffAttr = 120 ' "OFF" attribute
tYesNo.ShdoFore = 0 ' shadow foreground color if < 16
TBoxDRAW 2, 6, 18, 70, 1, 25
TprintTEXT 3, 8, 15, 66, T$, 1, 124, 19, 31
SELECT CASE fYesNo?( tYesNo, 17, 8, 66, 0 )
CASE 0 : A$ = "You pressed <ESC>"
CASE 1 : A$ = "You indicated <YES>"
CASE 2 : A$ = "You indicated <NO>"
END SELECT
Tprint 21, 1, A$, 14
' ───────────────────────────────────────────────────────────────────────────
FUNCTION fGetKey% () LOCAL PUBLIC
WHILE NOT INSTAT : WEND
fGetKey% = CVI( INKEY$ + CHR$(0) )
END FUNCTION