numCharacters = pos(deviceType)
This function returns a number which means different things depending on the value of
deviceType. Use one of the following values for
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:
- You send a carriage-return character to any window or
route'd device (this is usually the final character sent by a
print statement); or:
- The text in any window or
route'd device reaches the right margin and wraps around to the next line; or:
- You open a new window with the
window statement; or:
- You start a new print job with the
route _toPrinter statement.
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.
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.
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.
To determine the current horizontal pen position (in pixels), use the
csrlin; width; page function; window function