QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

The STEP keyword is used in FOR…NEXT loops to skip through the count or to count down instead of up. Used in graphics to designate a relative coordinate position of a graphics object function.

Syntax

FOR counter_variable = start_point TO stop_point [STEP interval]

CIRCLE STEP(0, 0), 10, 12

Example(s)

Stepping down 2 in a FOR counter loop.


FOR...NEXT i = 10 TO 0 STEP -2
  PRINT i;
NEXT 

 
10 8 6 4 2 0 

Note: The value of i = -2 after the loop is done.

Graphics Syntax: LINE STEP(column1%, row1%)-(column2%, row2%), color_attribute%

Graphics Example: Using STEP coordinates to PAINT a circle’s interior.


SCREEN 12
CIRCLE (100, 100), 50, 12
PAINT STEP(0, 0), 13, 12 

Explanation: PAINT uses the CIRCLE’s center coordinate position to paint the interior.

See Also