Specifications
Section 10. CRBASIC Programming Instructions
10-24
10.7 String Functions
& Concatenates string variables
+ Concatenates string and numeric variables
10.7.1 String Operations
String Constants
Constant strings can be used in expressions using quotation marks, i.e.
FirstName = “Mike”
String Addition
Strings can be concatenated using the ‘+’ operator, i.e
FullName = FirstName + “ “ + MiddleName + “ “ + LastName
String Subtraction
String1-String2 results in an integer in the range of -255..+255.
String Conversion to / from Numeric
Conversion of Strings to Numeric and Numeric to Strings is done
automatically when an assignment is made from a string to a numeric or a
numeric to a string, if possible.
String Comparison Operators
The comparison operators =, >,<,<>, >= and <= operate on strings.
String Output Processing
The Sample() instruction will convert data types if source data type is
different than the Sample() data type. Strings are disallowed in all output
processing instructions except Sample().
10.7.2 String Commands
ASCII
Returns the ASCII value of a character in a string.
Syntax
Variable = ASCII (ASCIIString(1,1,X))
CHR
Insert an ANSI character into a string.
Syntax
CHR (Code)
CheckSum
Returns a checksum signature for the characters in a string.
Syntax
Variable = CheckSum (ChkSumString, ChkSumType, ChkSumSize)
FormatFloat
Converts a floating point value into a string.
Syntax
String = FormatFloat (Float, FormatString)