String Variables
Basics
String variables have $ sign at the end:
mystring$
To asign a string to the variable we use:
mystring$ = 'This is a text'
Note: we use ' not " character
To put a ' character (Like in Oscar's) use \'
Example:
mystring$ = 'This is Oscar\'s project'
You can add backslash at the end of a string by using \\
path$ = 'c:\mydir\\'
will be displayed as c:\mydir\
Strings can use operator plus (as many as you want):
a$ = 'MMB '
mystring$ = a$ + 'is cool'
CHAR function
You cannot mix numerical and string variables.
To convert a numerical variable to string we use CHAR function
mystring$ = CHAR(value)
VAL function
To convert a string variable to numerical variable we use VAL function
mystring$='1.222'
String in IF-END command
We use similar syntax to numerical variables:
if (mystring$='yes')
....
end
or
if (mystring$<>'yes')
...
end