Skip to content

POS ​


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

Syntax ​

vb
declare function Pos ( ) as long
declare function Pos ( byval dummy as long ) as long

Usage ​

` result = Pos[ ( dummy ) ]

`

Parameters ​

dummy

An 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.

Examples ​

start GeSHi

vb
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()

end GeSHi

Differences from QB ​

  • The dummy parameter was not optional in QBASIC.

See also ​

  • Csrlin
  • Tab
  • Locate

Back to DocToc

Translated from FreeBASIC official docs. Contact us for removal if infringed.
FreeBASIC is an open-source project, not affiliated with Microsoft