TAB$ function

Purpose

Return a string with embedded TAB ($TAB) characters expanded with spaces to a given tab stop.

Syntax

sResult$ = TAB$(strtotab$, tabstop&)

Remarks

All TAB (CHR$(9) or $TAB) characters in strtotab$ are replaced with spaces to pad the resulting string to the tab stop position specified in tabstop&strtotab$ and tabstop& may be variables, literals, or expressions.

Restrictions

If the tab stop specified in tabstop& is less than 1 or greater than 256, the original string is returned unchanged.

See also

PARSE$, REPLACE

Example

a$ = "Hello" & $TAB & "World" & $TAB & _

  "From PB, Inc."

b$ = TAB$(a$,8)

Result

b$ contains "Hello   World   From PB, Inc."