A string is a sequence of Unicode characters.
Strings are a computer's way of storing and manipulating text. Strings may consist of words, punctuation, and nonsense characters. They can even be numbers: although a string containing numbers cannot be directly used in a mathematical expression (you can convert a string value to an int value and use that in a mathematical expression). See _string_to_int().
Note: There are many String Functions which do operations on or with strings.
In UJML, a string is a reference data type with the value stored as an array of characters in memory. Strings in UJML always consist of Unicode characters with integer code point values from 0x0001 to 0xFFFF. See _getCharacterCode().
String literals
String literals in script blocks are surrounded with quotes. See Literals and Constants.
The following example shows how to declare a string variable. It is part of the assignment.ujml sample.
<var name="mStringVar" type="string"/>
The following example shows how to set the variable declared above to a string literal. Note that this is not a number because it is surrounded by double quotes. It is part of the assignment.ujml sample.
mStringVar = "-1024";
The following example shows how to set the variable declared above to the result of a function call. It is part of the assignment.ujml sample.
mStringVar = aFunction(false, 2000000, "Foo");
The following example shows how to set an int variable to the result of a string conversion function call. It is part of the assignment.ujml sample.
mStringVar = "-1024"; mIntVar = _string_to_int(mStringVar);
The following example shows how to set a string variable to the result of a string function call. It is part of the assignment.ujml sample.
mStringVar = _substring(mStringVar, _strlen(mStringVar) - 3, _strlen(mStringVar));
|
Copyright (c) 2000-2007 UIEvolution, Inc. All rights reserved.
|
|
What do you think about this topic? Send feedback!
|