home *** CD-ROM | disk | FTP | other *** search
- '****************************************************************************
- ' WOPEN.BAS - Demo of how to open a window.
- '****************************************************************************
- REM $DYNAMIC
- DEFINT A-Z 'Make all variables integers by default.
- CALL QWINIT(4) 'Need to call this command before using any QW commands.
- CLS 'Clear the screen.
- ' --------------------------------------------------------------------------
- 'Dimension integer arrays to hold screen contents under window.
- ' Size of array = (x2%-x1%+1) * (y2%-y1%+1)
- DIM SHARED ary1(700), ary2(800), ary3(700)
-
- ' Open our first window.
- w1 = 1 'Setup window id variables. Each should be unique.
- ax1 = 1 'Left side of window (Column).
- ax2 = 38 'Right side.
- ay1 = 3 'Top of window (Row).
- ay2 = 18 'Bottom.
- astyle = 2 'Style = 2 = Double line border.
- acolor = &H40 'Color = black(0) on red(4).
- atitle$ = "WINDOW ONE" 'Window's title, null ("") if no title desired.
- CALL WOPEN(ax1, ay1, ax2, ay2, astyle, acolor, atitle$, ary1(), w1)
- CALL WSETCSR(w1, 2, 12) 'Set Cursor Shape (Optional)
- CALL WCSRON(w1) 'Turn on cursor. (Optional here)
- CALL WCOLOR(w1, &H17) 'Set new color for printing.
-
- ' Do it again for second window.
- w2 = 2
- bx1 = 40: bx2 = 77: by1 = 3: by2 = 22: bstyle = 5
- bcolor = &HA: btitle$ = "WINDOW TWO"
- CALL WOPEN(bx1, by1, bx2, by2, bstyle, bcolor, btitle$, ary2(), w2)
- CALL WCOLOR(w2, 14)
- ' ---- & Fill both windows with strings ---
- FOR i = 1 TO 500 STEP 2
- CALL WPRINT(w1, STR$(i))
- CALL WPRINT(w2, STR$(i + 1))
- NEXT i
-
- ' Now open a THIRD window. This time we'll specify parameters directly
- ' in the call itself instead of using variables.
- w3 = 3
- CALL WOPEN(20, 6, 60, 15, 1, &H5, "WINDOW THREE", ary3(), w3)
- FOR i = 1 TO 500
- CALL WLOCATE(w3, 16, 4)
- CALL WPRINT(w3, MID$(STR$(i), 2))
- NEXT i
-
- '--- Now wait for user to press key, then close windows 1 at a time. ---
- LOCATE 1, 1: LINE INPUT "Press ENTER: "; a$
- CALL WCLOSE(w3)
- LOCATE 1, 1: LINE INPUT "Press ENTER again: "; a$
- CALL WCLOSE(w2)
- LOCATE 1, 1: LINE INPUT "Press ENTER one more time: "; a$
- CALL WCLOSE(w1)
-
-