•  Back 
  •  Main 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The GFA-Basic Compendium
Author      : GFA Systemtechnik GmbH
Version     : GFABasic.HYP v2.98 (12/31/2023)
Subject     : Documentation/Programming
Nodes       : 899
Index Size  : 28056
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Document not found
@help       : Help
@options    : +g -i -s +z
@width      : 75
@hostname   : STRNGSRV
@hostname   : CAB     
@hostname   : HIGHWIRE
@hostname   : THING   
View Ref-FileSTRING$(x,a$)
STRING$(x,code)
SPACE$(x)
SPC(x)

x, code: iexp
a$: sexp

The function STRING$() returns a string which reproduces the expression 'a$'
(or ASCII character whose number is 'code') x times, where x has a maximum
value of 32767.

SPACE$() returns a string consisting of x spaces.

SPC() inserts x spaces in a PRINT statement without the need to create a string
variable or to explicitly specify the spaces by " ".

Example:

    a$="GFA "
    b$=SPACE$(5)
    PRINT b$;STRING$(3,a$);SPC(4);STRING$(5,65)

--> '     GFA GFA GFA     AAAAA' appears on the screen.

Memo: STRING$() compiled issues the wrong error code (#15).
      Interpreter issues #10 as it should be.

      SPACE$() and STRING$(count,code) do weird things without of range
      string sizes in compiled applications. No error is generated and the
      string LEN() ends up -negative.