Category : BASIC Source Code
Archive   : QBWINDOW.ZIP
Filename : DIALOG.BAS

 
Output of file : DIALOG.BAS contained in archive : QBWINDOW.ZIP
'****************************************************************************
' DIALOG.BAS - BASIC demonstration of how to make a Simple Dialog Box
'****************************************************************************
'
REM $DYNAMIC
DEFINT A-Z 'Make all variables integers by default.
DIM SHARED w(2000) 'Dimension an integer array for our window.
CALL QWINIT(4) 'Need to call this command before using any QW commands.
CLS 'Clear the screen.
wx1 = 20 'Left side of window.
wy1 = 9 'Top.
wx2 = 60 'Right side.
wy2 = 13 'Bottom.
wstyle = 2 'Double Line border
wincolor = &H74 'Color = Red on White.
wtitle$ = "" 'No title on window.
id = 1 'Window id# = 1
CALL WOPEN(wx1, wy1, wx2, wy2, wstyle, wincolor, wtitle$, w(), id)
CALL WCOLOR(id, &H71)
CALL WCLS(id)
CALL WCSRON(id)
CALL WPRINT(id, "~ Filename")
CALL WBOX(id, 11, 0, 36, 2, 1, &H74) 'Make a box around input.
CALL WLOCATE(id, 12, 1) 'Locate cursor inside window where you want input.
text$ = SPACE$(23) 'MUST initialize input string to desired length!!

' Setup edit variable to set options as follows:
' 1 = Keep old contents of string when enter WINPUT
' 32 = Convert lower case to upper.
' 128 = Beep if > max characters.
' 256 = Allow INS/DEL editing
' 512 = Allow HOME key to position cursor in field.
' 1024 = Allow END key to postion cursor in field.
edit = 1 + 32 + 128 + 256 + 512 + 1024

' Setup exit variable as follows:
exits = 16384 ' Means WINPUT will exit if ESCAPE key is pressed.

' Now do actual WINPUT!
CALL WINPUT(id, text$, 1, edit, exits, "", kb, flag)
IF flag = 1 THEN filename$ = text$
CALL WCLOSE(id)
PRINT "You've entered: "; filename$





  3 Responses to “Category : BASIC Source Code
Archive   : QBWINDOW.ZIP
Filename : DIALOG.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/