122-32000 Parallax Inc, 122-32000 Datasheet - Page 311

MANUAL PROPELLER

122-32000

Manufacturer Part Number
122-32000
Description
MANUAL PROPELLER
Manufacturer
Parallax Inc
Datasheets

Specifications of 122-32000

Accessory Type
Manual
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
Propeller Education (PE) Kit
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
STRSIZE
Get size of string.
((PUB ┆ PRI))
Returns: Size (in bytes) of zero-terminated string.
Explanation
STRSIZE
string.
including, a zero-termination byte.
Using STRSIZE
The following example assumes
PUB Main
DAT
The above example has two zero-terminated strings in the
Main
displays a value, this example prints 11 and 8 on the display.
Zero-Terminated Strings
The
to 0 must immediately follow the string. This practice is quite common and is recommended
since most string-handling methods rely on zero terminators.
STRSIZE
Print(strsize(@Str1))
Print(strsize(@Str2))
Str1 byte "Hello World", 0
Str2 byte "Testing.", 0
STRSIZE
method calls
StringAddress
STRSIZE
is one of two commands (
( StringAddress )
command requires the string being measured to be zero-terminated; a byte equal
measures the length of a string at StringAddress, in bytes, up to, but not
STRSIZE
is an expression specifying the starting address of the string to measure.
to get the length of each string. Assuming
Print
STRCOMP
4: Spin Language Reference –
is a method created elsewhere.
and
STRSIZE
) that retrieve information about a
DAT
Propeller Manual v1.0 · Page 311
block,
Print
Str1
is a method that
and
Str2
. The

Related parts for 122-32000