Help Center
Help CenterFreeBASIC

Posfunction

Returns the horizontal (left to right) position of the text cursor

Console Functionsfunctiondocumented

Syntax

Declare Function Pos ( ) As Long
Declare Function Pos ( ByVal dummy As Long ) As Long

Parameters

NameDescription
dummyAn unused parameter retained for backward compatibility with QBASIC.

Return value


Returns the horizontal position of the text cursor.

Description


Returns the horizontal (left to right) position of the text cursor. The leftmost column is number 1.

Remarks

Usage


result = Pos[ ( dummy ) ]

Differences from QB


  • The dummy parameter was not optional in QBASIC.

See also


Example


Dim As Long p



'' print starting column position

p = Pos()

Print "position: "; p



'' print a string, without a new-line

Print "ABCDEF";



'' print new column position:

p = Pos()

Print: Print "position: "; p

Print



''position changes after each Print:

Print "Column numbers: "

Print Pos(), Pos(), Pos(), Pos(), Pos()

Reference

  • Documented in KeyPgPos.html