Data Sheet

dScript
dScript User Manual v2.15
String variables
A string variable is used to hold ASCII character strings. The length of the string variable may
be up to the lesser of 65535 bytes or the remaining memory. The size of a string variable is
declared by placing the size in square brackets immediately after the name.
string myStringName[100]
declares a string called myStringName which is can hold up to 100 characters.
You can have any number of string variables up to the limit of the on-board RAM memory.
Strings can be named as you choose, there are no built in limits to the length of the name so
be descriptive. string names are case sensitive so:
string myStringname[100]
string myStringName[100]
are two different variables.
String variable names are not loaded into the module. All variables are compiled to an index
code, so long variable names neither consume valuable memory space on the module or slow
down program execution.
String parameters
There are two parameters of a string available.
string s1[100]
var Length
var Size
s1 = "Hello World"
Length = s1.Length
Size = s1.Size
Length will have the length of the string in s1, in this case it is 11
Size will have the original declared size of s1, 100 in this case.
Copyright © 2016, Devantech Ltd.
All rights reserved.
www.robot-electronics.co.uk
13