Difference between revisions of "SPC"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
m (Text replacement - "{{Parameters}}" to "{{PageParameters}}")
 
(One intermediate revision by one other user not shown)
Line 6: Line 6:
  
  
{{Parameters}}
+
{{PageParameters}}
* ''count'' designates the number of spaces to move in a [[PRINT]] statement.
+
* ''count'' designates the number of column spaces to move the cursor in a [[PRINT]] statement.
  
  

Latest revision as of 12:40, 17 February 2021

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


Syntax

SPC(count%)


Parameters

  • count designates the number of column spaces to move the cursor in a PRINT statement.


Usage:

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


Example: Using SPC to space a text print.

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

123456789 abc 123


See also



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