Radio Shack CTR-118 User Manual Page 70

  • Download
  • Add to my manuals
  • Print
  • Page
    / 196
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 69
5-4
String Operations
Not including the functions described below, there is only one string
operation - concatenation, represented by the plus symbol +.
Example Programs:
10 CLEAR 75
20 A$="A ROSE"
30 B$=" IS A ROSE"
40 C$=A$+B$+B$+B$+".'
50 PRINT C$
RUN
A ROSE IS A ROSE IS A ROSE IS A ROSE.
READY
>_
In line 40, the strings are concatenated - strung together.
10 T$="100"
20 SUB$="5"
30 CODE="32L"
40 LC$=T$+"."+SUB$+CODE$
50 PRINT LC$
RUN
100.532L
READY
>_
String Space
50 bytes of memory are set aside automatically to store strings. If you run out
of string space, you will get an OS error and you should use the CLEAR n
command to save more space. See page 2/2.
To calculate the space you'll need, multiply the amount of space each variable
takes (See page 8/13 VARPTR) by the number of string variables you are
using, including temporary variables.
Temporary variables are created during the calculation of string functions. In
the first example above, line 40, C$ is the result of four calculations. For each
of these four, the Computer uses memory space from the string storage area
to store the temporary result. Therefore, even if you have only a few short
string variables assigned in your program, you may run out of string space if
you concatenate them several times.
Page view 69
1 2 ... 65 66 67 68 69 70 71 72 73 74 75 ... 195 196

Comments to this Manuals

No comments