Difference between revisions of "SPC"

From QB64 Wiki
Jump to navigation Jump to search
imported>Stylin
(updated to new blueprint, modified according to discussion at http://www.qb64.net/forum/index.php?topic=801.0)
imported>Clippy
m
Line 3: Line 3:
  
 
{{PageSyntax}}
 
{{PageSyntax}}
:<code>{{KW|SPC}}({{Parameter|n%}})</code>
+
:{{KW|SPC}}({{Parameter|n%}})
  
  

Revision as of 14:57, 14 November 2010

The SPC function is used in PRINT and PRINT # statements to print or output a number of space characters.


Syntax

SPC(n%)


Description

  • When used in a PRINT statement,
    • n% is the number of space characters to print, overwriting existing characters.
    • If n% is greater than the number of columns left in the current row, the remaining space characters are printed on the next row at column 1.
  • When used in a PRINT # statement,
    • n% is the number of space characters to output.
  • If n% is less than or equal to zero, the function has no effect.


Examples

PRINT "123456789" PRINT "abc" ; SPC(3) ; "123"

123456789 abc 123


See also



Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page