Tab Function

Syntax

Tab[(colno)]


colno

Use: Optional

Data Type: Integer

A column number to which the insertion point moves before displaying or printing the next expression.

Description

Moves the text insertion point to a given column or the start of the next print zone

Rules at a Glance

  • If the colno argument is omitted, the text insertion point is moved to the beginning of the next print zone.

  • The value of colno determines the behavior of the insertion point:

    Value of colno Position of Insertion Point
    Current column > colno Moves one line down and moves to the colno column.
    colno > Output Width Uses the formula colno Mod width. If the result is less than the current insertion point, the insertion point moves down one line; otherwise, the insertion point remains on the same line.
    < 1 Column 1

  • The left column is always 1.

  • When expressions are output to files using the Print # statement, the width of the output is determined by the Width # statement.

  • When output is sent to either the screen or the printer, the surface is divided into columns, the width of each column being the average width of all characters in the current point size of the current font. This means that the number of columns for tabulation purposes doesn't necessarily relate to the number of characters that can be printed across the width of the output surface.

Programming Tips and Gotchas

  • When placing output on the Printer object, use the TextWidth method to determine the actual width of a given string in a given font and font size. Another more flexible (although more complex) method of setting the current print position for the Printer object is to set the CurrentX property.

  • The Tab function without a colno argument is useful when outputting data to a file using the Print # statement in locales where the comma would be recognized as a decimal separator.

See Also

Width # Statement
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.103.183