FutureBasic Logo

<<    Index    >> FutureBasic 5

pos   function



Syntax:
numCharacters = pos(deviceType)

Description:
This function returns a number which means different things depending on the value of deviceType. Use one of the following values for deviceType.
nbsp;_anyDev
pos(_anyDev) returns information about the number of characters sent by the print statement to screen windows or to the device specified by the most recent route statement. The value of pos(_anyDev) is incremented whenever you print a character (other than a carriage-return) to any open window or to the route'd device. The value of pos(_anyDev) is reset to zero whenever any of the following happens:
Note that pos(_anyDev) often, but not always, represents the number of characters on the current line of text. However, because FutureBasic does not maintain separate pos values for separate windows, the value returned by pos(_anyDev) may represent the characters on a line in the current window, or on a line in a different window, or even the sum of the characters on lines in multiple windows.
nbsp;_printerDev
pos(_printerDev) returns the number of characters printed so far on the current line of text sent to the printer. The value of pos(_printerDev) is incremented whenever you send a chacter (other than carriage-return) to the printer; the value is reset to zero whenever you send a carriage-return character to the printer, or the text reaches the right margin and wraps around to the next line.
nbsp;_diskDev
pos(_diskDev) returns information about characters sent to open files. The value of pos(_diskDev) is incremented whenever you send a character (other than carriage- return) to any open file; the value is reset to zero whenever you send a carriage-return character to any open file. Note that if you have more than one file open, the value returned by pos(_diskDev) reflects the sum of the characters sent to all the files you're writing to. If you write a total of more than 32767 characters (to all open files) without writing a carriage-return character, the number returned by pos(_diskDev) is invalid.

Note:
To determine the current horizontal pen position (in pixels), use the window(_penH) function.

See Also:
csrlin; width; page function; window function