DI-159 PLC Hardware Manual
StickOS
Strings
StickOS supports string variables as a null-terminated views into byte arrays.
A string variable may be declared, with a maximum length n, with:
dim var$[n]
A string may then be assigned with:
let variable$ = string
Where string is an expression composed of one or more of:
"literal"
literal string
variable
$
variable string
variable
$
[
start
:
length
]
variable substring
+
string concatenation operator
A string may be tested in a conditional statement with a condition of the form:
if
string relation string
then
while
string relation string
do
until
string relation string
Where relation is one of:
<= < >= > inequalities
== !=
equal, not equal
~ !~
contains, does not contain
The current length of a string can be represented in an integer expression by:
variable
#
Strings may also be explicitly specified in dim, input, let, print, and vprint statements.
Examples
>
new
>
10 dim i, a$[10]
>
20 input a$
>
30 for i = 0 to a#-1
44
Summary of Contents for DI-159
Page 51: ...StickOS DI 159 PLC Hardware Manual 4 is even _ 51...
Page 76: ...DI 159 Block Diagram 76...
Page 77: ...Dimensional Drawing 77...