Tab: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
The '''TAB(X)''' [[internal function]] | The '''TAB(X)''' [[internal function]] positions the cursor at column x (similar to POS in a FORM statement), where x is any numeric expression. If the current position of the line is greater than column x, the cursor is positioned at column x in the next line. If x is negative, TAB(1) is assumed. If x is not an integer, it is rounded. If x is greater than the record length, the cursor is positioned at column 1 in the next line. | ||
====Comments and Examples==== | ====Comments and Examples==== | ||
Line 5: | Line 5: | ||
00010 PRINT TAB(3) | 00010 PRINT TAB(3) | ||
Line 10 | Line 10 positions the cursor on the screen at position 3. | ||
====Related Functions==== | ====Related Functions==== |
Revision as of 17:38, 19 January 2012
The TAB(X) internal function positions the cursor at column x (similar to POS in a FORM statement), where x is any numeric expression. If the current position of the line is greater than column x, the cursor is positioned at column x in the next line. If x is negative, TAB(1) is assumed. If x is not an integer, it is rounded. If x is greater than the record length, the cursor is positioned at column 1 in the next line.
Comments and Examples
00010 PRINT TAB(3)
Line 10 positions the cursor on the screen at position 3.
Related Functions
Other special functions used mainly in PRINT are BELL and NEWPAGE.
Technical Considerations
- In an unformatted PRINT statement, when NEWPAGE precedes the TAB(X) function, the TAB function will appear to be off by one column because the character for NEWPAGE appears in the output buffer, but not on the screen or printer. Avoid using NEWPAGE (or BELL) before TAB in an unformatted PRINT statement. One remedy is to use one PRINT statement for NEWPAGE (and BELL) and another for the TAB function and other output.