beautypg.com

A.7 string functions, A.7.1 string operations, A.7.2 string commands – Campbell Scientific CR3000 Micrologger User Manual

Page 505

background image

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

Constant strings can be used in expressions using quotation marks.  For 
example: 

FirstName = "Mike"

String Addition

Strings can be concatenated using the '+' operator.  For example: 

FullName = FirstName + " " + MiddleName + " " + LastName

String Subtraction

String1‐String2 results in an integer in the range of ‐255..+255

String Conversion to/from Numerics

Conversion of strings to numerics and numerics 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 the source data type 
is different than the Sample() data type.  Strings are disallowed in all 
output processing instructions except Sample()

A.7.2 String Commands

ArrayLength 
Returns the length of a variable array. 

Syntax 

ArrayLength(Variable)

ASCII 
Returns the ASCII / ANSI code of a character in a string. 

Syntax 

Variable = ASCII(ASCIIString(1,1,X))