Difference between revisions of "SPACE$"
Jump to navigation
Jump to search
Navigation:
imported>Clippy m |
imported>Clippy m |
||
Line 3: | Line 3: | ||
{{PageSyntax}} | {{PageSyntax}} | ||
− | : | + | :''result$'' = {{KW|SPACE$}}({{Parameter|count%}}) |
Line 9: | Line 9: | ||
<!-- Stylin --> | <!-- Stylin --> | ||
* {{Parameter|count%}} is the number of space characters to repeat. | * {{Parameter|count%}} is the number of space characters to repeat. | ||
− | * If {{Parameter|count%}} is negative, an [[ERROR Codes|illegal function call]] error | + | * If {{Parameter|count%}} is negative, an [[ERROR Codes|illegal function call]] error will occur. |
<!-- /Stylin --> | <!-- /Stylin --> | ||
* Can be used in any string value using the + concatenation operator. | * Can be used in any string value using the + concatenation operator. | ||
− | * Semicolons | + | * Semicolons can be used to combine text [[STRING]] or numerical values. |
+ | * [[Concatenation]] using + can be used to combine [[STRING]] text values only. | ||
* Spaces are often used to erase previous text PRINTs from the screen. | * Spaces are often used to erase previous text PRINTs from the screen. | ||
* Spaces can also be made using [[SPC]], [[CHR$]](32) or [[STRING$]](n%, 32). | * Spaces can also be made using [[SPC]], [[CHR$]](32) or [[STRING$]](n%, 32). | ||
Line 30: | Line 31: | ||
{{PageSeeAlso}} | {{PageSeeAlso}} | ||
− | * | + | * [[PRINT]], [[PRINT USING]] |
− | * | + | * [[STRING$]] |
+ | * [[SPC]], [[TAB]] | ||
{{PageNavigation}} | {{PageNavigation}} |
Revision as of 21:22, 10 March 2011
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 will occur.
- Can be used in any string value using the + concatenation operator.
- Semicolons can be used to combine text STRING or numerical values.
- Concatenation using + can be used to combine STRING text values only.
- Spaces are often used to erase previous text PRINTs from the screen.
- Spaces can also be made using SPC, CHR$(32) or STRING$(n%, 32).
Examples
FOR count% = 0 TO 3 PRINT "abc" + SPACE$( count% ) + "def" NEXT count%
abcdef abc def abc def abc def
See also