* DRAW statements are not Case sensitive. Use upper or lower case.
:* "'''B'''" (Blind) before a line move designates that the line move will be hidden. Use to offset from a "P" or [[PAINT]] border.
:* "'''C''' n" designates the color attribute or [[_RGB]] [[STR$|string]] numerical color value to be used in the draw statement immediately after.
:* "'''A''' n" can use values of 1 to 3 to rotate up to 3 90 degree(270) angles.
:* '''TA''' n" can use any n angle from -360 to 0 to 360 to rotate a DRAW (Turn Angle). "TA0" resets to normal.
:* When [[VARPTR$]] is used DRAW functions such as '''TA''' angles use an equal sign: "TA=" + VARPTR$(angle%)
* '''DRAW can be used in any graphic screen mode, but cannot be used in the default screen mode 0 as it is text only!'''
''Example 1:'' Placing an octagon shape DRAW across the the screen using PSET.
{{CodeStart}} '' ''
SCREEN 12
octagon$ = "C12 R10 F10 D10 G10 L10 H10 U10 E10" 'create a DRAW string value
{{Cl|SCREEN (statement)|SCREEN}} 12
FOR i% = 1 TO 11
{{Cl|PSET}} (i% * 50, 100), 15
{{Cl|_DELAY}} .5 ' delay for demo
{{Cl|DRAW}} octagon$ ' DRAW the octagon using variable
{{Cl|_DELAY}} .5 ' delay for demo
NEXT i% '' ''
{{CodeEnd}}
''Explanation:'' Once a DRAW string variable is created, it can be used to draw a shape throughout the program at any time.
''Example 2:'' Creating an analog clock's hour markers using "TA=" + [[VARPTR$]](angle).
{{CodeStart}} '' ''
SCREEN 12
FOR angle = 0 TO 360 {{Cl|STEP}} 30 ' 360/12 hour circles = 30 degrees apart
PSET (175, 250), 6 ' stay at center point of clock
{{Cl|DRAW}} "TA=" + {{Cl|VARPTR$}}(angle) + "BU100" ' move invisibly to set next circle's center point
{{Cl|CIRCLE}} {{Cl|STEP}}(0, 0), 5, 12 ' circle placed at end of blind line
{{Cl|DRAW}} "P9, 12" ' paint inside of circle
{{Cl|SLEEP}} 1 ' slowed for demo only
NEXT '' ''
{{CodeEnd}}
''Explanation:'' To place 12 circles in a circle each move is 30 degrees. PSET sets the center of the circular path every loop. TA moves counter-clockwise with positive degree angles. Once TA sets the angle a blind Up move is at that angle. The hour circles use the end point of the blind line as centers using the STEP relative coordinates of 0. After the circles are drawn, a draw "P" string paints the circle centers. DRAW paint strings use the last coordinate position also.
DO: sec$ = {{Cl|RIGHT$}}({{Cl|TIME$}}, 2) ' get actual seconds from TIME$ function
degree$ = {{Cl|STR$}}({{Cl|VAL}}(sec$) * -6) ' 60 second moves. TA uses negative angles for clockwise moves
{{Cl|PSET}} (175, 250), 9 ' stay at clock center
DRAW "TA" + degree$ + "U90" ' up becomes TA directional line
DO: LOOP UNTIL RIGHT$(TIME$, 2) <> sec$ ' wait for a new second value
IF INKEY$ <> "" THEN {{Cl|EXIT DO}} ' any key exit
PSET (175, 250), 0 ' set at clock center to erase line
DRAW "TA" + degree$ + "U90" ' erases old second hand line using color 0 from PSET
LOOP
{{CodeEnd}}
''Explanation:'' The degrees to move from the original UP line move is calculated by dividing 360/60 seconds in a full rotation. That value of 6 is made negative to use TA correctly and multiplied by the [[VAL]]ue of seconds from the TIME$ function. The degree angle is converted by [[STR$]] to a string and added to the DRAW string using the [[STRING]] '''concatenation +''' operator. DO NOT USE SEMICOLONS to create DRAW strings! Once the second hand is placed on the screen, a loop waits for the second value to change. It then erases the hand and it repeats the process again.