Difference between revisions of "SPACE$"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>Clippy
m
Line 8: Line 8:
 
{{PageDescription}}
 
{{PageDescription}}
 
<!-- Stylin -->
 
<!-- Stylin -->
* {{Parameter|count%}} is the number of space characters to repeat.
+
* {{Parameter|count%}} is the number of space characters to repeat. Cannot use negative values!
* If {{Parameter|count%}} is negative, an [[ERROR Codes|illegal function call]] error will occur.
+
* Semicolons can be used to combine spaces with text [[STRING]] or numerical values.
<!-- /Stylin -->
 
* 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.
 
* [[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.

Revision as of 21:24, 10 March 2011

The SPACE$ function returns a STRING consisting of a number of space characters.


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.
  • 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



Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page