SPACE

SPACE returns a string of the specified length that contains only white spaces (ASCII 32):

SPACES is the synonym for SPACE.

SPACE has one – left – operand. This operand is an integer value or expression.

In a PRINT statement, the operand must be no greater that the difference

(right margin – current character position)

SPACE returns a string of white space which number is equal to its operand.

These spaces are inserted at the current character position.

SPACE operator can be used in different statements but usually it appears in the PRINT and DISPLAY statements.

In PRINT statements, SPACE moves the current character position to the right by the specified number of white spaces:

PRINT fname, 2 SPACES, lname

In DISPLAY statements, SPACE inserts the specified number of white spaces into the output:

DISPLAY "Hello,", 15 SPACES, "world!"

It is recommended to put SPACE and its operand in parentheses when you use it outside the PRINT statement.

SPACE operator is sometimes confused with the COLUMN operator.

This example program shows how to use SPACE with a DISPLAY statement:

MAIN
DEFINE my_spaces_string char(80)
LET my_spaces_string = "-->",(5+5 SPACES),"<--"
DISPLAY "*** SPACES Example ***" AT 1,5
DISPLAY "my_spaces_string = \"-->\",(5+5 SPACES),\"<--\"" at 3,1
DISPLAY "   1234567890" at 5,1
DISPLAY my_spaces_string at 6,1
CALL fgl_getkey()
END MAIN

In this example program, SPACE is used

FORMAT
  ON EVERY ROW
    LET mystring = (8 SPACES), "=ZIP"
    PRINT cont_fname, 2 SPACES, cont_lname
    PRINT comp_name
    PRINT comp_addr1
    PRINT comp_city, ", " , comp_zone, 2 SPACES, comp_zip, mystring

 

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.