home *** CD-ROM | disk | FTP | other *** search
- '****************************************************************************
- ' 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$
-
-
-
-