Commands and functions
P.
225 of 349
Split
Size
Definition
●
Function
split
(
string
,
pos1, pos2
)
Arguments
●
3 arguments,
string
of data type c1400,
pos1
and
pos2
of data type u16
Effect
●
string
: Character string a character string shall be extracted from.
●
pos1
: Position of the first character of the character string to be extracted (0...1399u16).
●
pos2
: Position of the last character of the character string to be extracted (0...1399u16). If
pos2
equals 65534u16 (predefined constant END), the character string will be separated
up to its end.
●
The variable
string
must be of data type c1400.
●
Return value: The character string extracted from
string
.
Data type result (Return)
●
A character string of data type c1400.
Example: split
The character string „String“ shall be extracted from the variable string=$CharacterString$.
The first character of the character string to be separated has position 8 (counting starts at 0),
the last character has position 13.
Implementation in the user program:
string=$CharacterString$
result=split(string, 8u16,13u16)
Example: Search a character string (2)
The character string “Hello” shall be separated from the variable
string=$CharacterString:Hello$.
Implementation in the user program:
String=$CharacterString:Hello$
PartialString=split(String,find(String,$:$,0u16),1399u16)
Definition
●
Function
size
(
string
)
Arguments
●
1 argument
string
of data type c1400
Effect
●
The length of character string
string
shall be determined. The length is given by the
termination character ”\0“ at the end of character strings.
Data type result (Return)
●
Data type u16
Example: size
The length of string=$CharacterString$ shall be determined.
Implementation in the user program:
string=$CharacterString$
result=size(string)
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]