StickOS
DI-159 PLC Hardware Manual
Variable Print Statements
Variable print statements can be used to convert strings to integers and vice versa, as well as
integers from decimal to hexadecimal radix, etc. Basically, variable print statements are iden-
tical to print statements, except rather than printing the result to the console, the result is
"printed" to a variable.
Variable print statements can be used to print integer expressions, using either a decimal or hex-
adecimal output radix, or printing raw ASCII bytes:
vprint
variable
[
$
] = [
dec
|
hex
|
raw
]
expression
Or strings:
vprint
variable
[
$
] =
string
Or various combinations of both:
vprint
variable
[
$
] =
string
, [
dec
|
hex
|
raw
]
expression
, ...
In all cases, the resulting output is assigned to the specified integer or string variable. If a type
conversion error occurs (such as assigning a non-integer string to an integer variable), program
execution stops.
Examples
>
clear
>
dim a, b$[10]
>
let b$="123"
>
vprint a = b$[0:2]+"4"
>
print a
124
>
vprint b$ = "hello", a
>
print b$
hello 124
> _
47
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...