qb45advr.hlp (Topic list)
DRAW Statement Programming Examples
  QuickSCREEN      Details     Example      Contents      Index
──────────────────────────────────────────────────────────────────────────────
DRAW Statement Programming Examples
 
Example 1
 
The following program draws a triangle's outline in magenta and paints
the interior cyan:
 
SCREEN 1
DRAW "C2"             'Set color to magenta.
DRAW "F60 L120 E60"   'Draw a triangle.
DRAW "BD30"           'Move down into the triangle.
DRAW "P1,2"           'Paint interior.
 
Example 2
 
The following example shows how to use the M macro command:
    ■ with absolute and relative movement
    ■ with string- and numeric-variable arguments
 
SCREEN 2
PRINT "Press any key to continue..."
'Absolute movement
DRAW "M 50,80"
DRAW "M 80,50"
LOCATE 2, 30: PRINT "Absolute movement"
DO
LOOP WHILE INKEY$ = ""
'Relative movement
DRAW "M+40,-20"
DRAW "M-40,-20"
DRAW "M-40,+20"
DRAW "M+40,+20"
LOCATE 3, 30: PRINT "Relative movement"
DO
LOOP WHILE INKEY$ = ""
'Using a string variable.
X$ = "400": Y$ = "190"
DRAW "M" + X$ + "," + Y$
LOCATE 4, 30: PRINT "String variable"
DO
LOOP WHILE INKEY$ = ""
'Using numeric variables (note the two "=" signs).
A = 300: B = 120
DRAW "M=" + VARPTR$(A) + ",=" + VARPTR$(B)
LOCATE 5, 30: PRINT "Numeric variables"
 
Example 3
 
DRAW_EX.BAS is a program file in the subdirectory ADVR_EX that illustrates
the DRAW statement. To look at the program in the View window and,
optionally, to run it, load DRAW_EX.BAS using the File menu's Open Program
command.
 
The program draws a clock on the screen using the TIME$ function.