home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 14 / CDACTUAL.iso / cdactual / demobin / share / program / Basic / QWINDO.ZIP / DIALOG.BAS < prev    next >
Encoding:
BASIC Source File  |  1990-01-01  |  1.8 KB  |  47 lines

  1. '****************************************************************************
  2. ' DIALOG.BAS - BASIC demonstration of how to make a Simple Dialog Box
  3. '****************************************************************************
  4. '
  5. REM $DYNAMIC
  6. DEFINT A-Z              'Make all variables integers by default.
  7. DIM SHARED w(2000)      'Dimension an integer array for our window.
  8. CALL QWINIT(4)          'Need to call this command before using any QW commands.
  9. CLS                     'Clear the screen.
  10. wx1 = 20                'Left side of window.
  11. wy1 = 9                 'Top.
  12. wx2 = 60                'Right side.
  13. wy2 = 13                'Bottom.
  14. wstyle = 2              'Double Line border
  15. wincolor = &H74         'Color = Red on White.
  16. wtitle$ = ""            'No title on window.
  17. id = 1                  'Window id# = 1
  18. CALL WOPEN(wx1, wy1, wx2, wy2, wstyle, wincolor, wtitle$, w(), id)
  19. CALL WCOLOR(id, &H71)
  20. CALL WCLS(id)
  21. CALL WCSRON(id)
  22. CALL WPRINT(id, "~  Filename")
  23. CALL WBOX(id, 11, 0, 36, 2, 1, &H74) 'Make a box around input.
  24. CALL WLOCATE(id, 12, 1) 'Locate cursor inside window where you want input.
  25. text$ = SPACE$(23)      'MUST initialize input string to desired length!!
  26.  
  27. ' Setup edit variable to set options as follows:
  28. '    1 = Keep old contents of string when enter WINPUT
  29. '   32 = Convert lower case to upper.
  30. '  128 = Beep if > max characters.
  31. '  256 = Allow INS/DEL editing
  32. '  512 = Allow HOME key to position cursor in field.
  33. ' 1024 = Allow END key to postion cursor in field.
  34. edit = 1 + 32 + 128 + 256 + 512 + 1024
  35.  
  36. ' Setup exit variable as follows:
  37. exits = 16384   ' Means WINPUT will exit if ESCAPE key is pressed.
  38.  
  39. ' Now do actual WINPUT!
  40. CALL WINPUT(id, text$, 1, edit, exits, "", kb, flag)
  41. IF flag = 1 THEN filename$ = text$
  42. CALL WCLOSE(id)
  43. PRINT "You've entered: "; filename$
  44.  
  45.  
  46.  
  47.