Difference between revisions of "SPACE$"
Jump to navigation
Jump to search
Navigation:
imported>Clippy m |
imported>Clippy m |
||
Line 12: | Line 12: | ||
* [[Concatenation]] using + can be used to combine [[STRING]] text values only. | * [[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. | ||
+ | * The function result can also be used to [[GET]] and [[PUT]] a number of bytes as zero characters: bytes$ = SPACE$(numbytes) | ||
* 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). | ||
Revision as of 19:36, 12 November 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. Cannot use negative values!
- Semicolons can be used to combine spaces with 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.
- The function result can also be used to GET and PUT a number of bytes as zero characters: bytes$ = SPACE$(numbytes)
- 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