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 POS function returns the current print cursor text column position.

Syntax

column% = POS(0)

Example(s)

Column positions after prints.


PRINT POS(0) 'column position always starts on 1 at top of new or after CLS
PRINT "hello"; 'column position is 6 on same row immediately after text
PRINT POS(0)
PRINT 'start new row
PRINT "hello", 'column position is 15 on same row (normally tabs 9 spaces)
PRINT POS(0)
PRINT 'start new row
PRINT
PRINT POS(0) ' column position is 1 on next row 

Note: Column tab prints may not always move 9 spaces past the center of the screen. Some may move text to next row.

See Also