POS
- Source: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgPos
- Last revised: 2022-03-25
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 longUsage
` 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
dummyparameter was not optional in QBASIC.
See also
CsrlinTabLocate
Back to DocToc