Difference between revisions of "SPACE$"
Jump to navigation
Jump to search
Navigation:
imported>Clippy m |
imported>Stylin (updated to new blueprint, added descriptions and example) |
||
Line 1: | Line 1: | ||
− | The | + | The {{KW|SPACE$}} function returns a {{KW|STRING}} consisting of a number of space characters. |
− | + | {{PageSyntax}} | |
− | : | + | :<code>''result$'' = {{KW|SPACE$}}( {{Parameter|count%}} )</code> |
− | |||
+ | {{PageDescription}} | ||
+ | <!-- Stylin --> | ||
+ | * {{Parameter|count%}} is the number of space characters to repeat. | ||
+ | * If {{Parameter|count%}} is negative, an [[ERROR Codes|illegal function call]] error is thrown. | ||
+ | <!-- /Stylin --> | ||
* Can be used in any string value using the + concatenation operator. | * Can be used in any string value using the + concatenation operator. | ||
* Semicolons or + can be used in a screen [[PRINT]] or [[PRINT (file statement)]]. | * Semicolons or + can be used in a screen [[PRINT]] or [[PRINT (file statement)]]. | ||
Line 12: | Line 16: | ||
+ | {{PageExamples}} | ||
+ | {{CodeStart}}{{Cl|FOR...NEXT|FOR}} count% = 0 {{Cl|FOR...NEXT|TO}} 3 | ||
+ | {{Cl|PRINT}} "abc" + {{Cl|SPACE$}}( count% ) + "def" | ||
+ | {{Cl|FOR...NEXT|NEXT}} count% | ||
+ | {{CodeEnd}} | ||
+ | {{OutputStart}}abcdef | ||
+ | abc def | ||
+ | abc def | ||
+ | abc def | ||
+ | {{OutputEnd}} | ||
− | + | {{PageSeeAlso}} | |
− | + | * {{KW|STRING$}} | |
− | + | * {{KW|SPC}}, {{KW|TAB}} | |
− | |||
− | |||
− | |||
− | |||
− | + | {{PageNavigation}} |
Revision as of 21:04, 28 February 2010
The SPACE$ function returns a STRING consisting of a number of space characters.
Contents
Syntax
result$ = SPACE$( count% )
Description
- count% is the number of space characters to repeat.
- If count% is negative, an illegal function call error is thrown.
- Can be used in any string value using the + concatenation operator.
- Semicolons or + can be used in a screen PRINT or PRINT (file statement).
- Spaces are often used to erase previous text PRINTs from the screen.
Examples
FOR count% = 0 TO 3 PRINT "abc" + SPACE$( count% ) + "def" NEXT count%
abcdef abc def abc def abc def
See also