beautypg.com

Integer, String or var, Left (searchstring, numchars) – Campbell Scientific CR9000X Measurement and Control System User Manual

Page 401: Len (sourcestring)

background image

Section 11. String Functions

Parameter
& Data Type

Enter

INSTR PARAMETERS

Start
Integer

Integer that specifies where in the SearchString to start looking for the
FilterString. A 1 Specifies the first character in the string

SearchStr
String or Var

The string to evaluate for the FilterString.

FilterString
String

String to look for in the SearchString. For a FilterString using non-printable
ASCII characters, use the CHR function and the appropriate ASCII code

SearchOpt

The SearchOption is a code used to help define the method of searching:.

Constan

0 NUMERIC - Numerics in the SearchString are returned (FilterString is

Ignored)

1 NON-NUMERIC - Non-numerics are returned (FilterString is ignored)

2 SEARCHSTRING - Each FilterString in SearchString

3 SEARCHCHARS - Each occurrence of any character in FilterString

4 HEADERFILTER - Strings succeeding FilterString are returned.

6 HEADERFILTERCHARS - Strings succeeding any character in the

FilterString char list are returned.

8 NUMERICHEX - Hexadecimal numerics in the SearchString are

returned (FilterString is ignored)

Left (SearchString, NumChars)

The Left function returns a substring that is a defined number of characters
from the left side of the original string.

Syntax
String = Left( SearchString, NumChars )

Parameter
& Data Type

Enter

LEFT PARAMETERS

String
String or Var

The string from which the Sub-string will be retrieved..

NumChars
Variable or
constant

The NumChars parameter is used to specify the number of characters from
the left side of the string to return.

.

Len (SourceString)

The Len function is used to return the number of bytes in a string.

Syntax
Variable = Len( SourceString )

Remarks
The SourceString must be declared as a variable. When defining the
SourceString variable, its size must be set large enough to accommodate the
expected string. Otherwise, the result returned by the Len function will be the
maximum size of the string, even if the actual string is larger (strings are null-
terminated; note that the null termination character counts as one of the
characters in the string). If a size is not specified when the SourceString
variable is defined, the default string size is 16.

11-5