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 TAB function is used in PRINT and LPRINT statements to move to a specified column position.

Syntax

TAB(column%)

Description

Example(s)

Comparing TAB to comma print spacing which moves the next text print 15 columns.


PRINT TAB(15); "T" 'TAB spacing

PRINT , "T" 'comma spacing

PRINT TAB(15); "T"; TAB(20); "A"; TAB(15); "B" 'semicolons add nothing to position

PRINT TAB(15); "T", TAB(20); "A"; TAB(15); "B" 'comma moves column position beyond 20 


              T
              T
              T    A
              B 
              T
                   A
              B

Explanation: TAB moves the PRINT down to the next row when the current column position is more than the TAB position.

See Also