
Appendix A. CRBasic Programming Instructions
505
A.7 String Functions
Read More! See String Operations (p. 241)
& Concatenates string variables.
+ Concatenates string and numeric variables.
- Compares two strings, returns zero if identical.
A.7.1 String Operations
String Constants
Constantstringscanbeusedinexpressionsusingquotationmarks.For
example:
FirstName = "Mike"
String Addition
Stringscanbeconcatenatedusingthe'+'operator.Forexample:
FullName = FirstName + " " + MiddleName + " " + LastName
String Subtraction
String1‐String2resultsinanintegerintherangeof‐255..+255.
String Conversion to/from Numerics
Conversionofstringstonumericsandnumericstostringsisdone
automaticallywhenanassignmentismadefromastringtoanumericor
anumerictoastring,ifpossible.
String Comparison Operators
Thecomparisonoperators=,>,<,<>,>=and<=operateonstrings.
Str
ing Output Processing
TheSample()instructionwillconvertdatatypesifthesourcedatatype
isdifferentthantheSample()datatype.Stringsaredisallowedinall
outputprocessinginstructionsexceptSample().
A.7.2 String Commands
ArrayLength
Returnsthelengthofavariablearray.
Syntax
ArrayLength(Variable)
ASCII
ReturnstheASCII/ANSIcodeofacharacterinastring.
Syntax
Variable = ASCII(ASCIIString(1,1,X))
Komentarze do niniejszej Instrukcji