Numbers can be written as integers, decimal numbers, in scientific notation with an E preceding the power of ten, and as date-time values. A single period by itself is the missing numeric value.
. 1 12 1.234 3E3 0.314159265E+1 1E-20
One or more characters placed within double quotation marks constitute a string. For example, these are all strings:
"Green" "Hello,\NWorld!" "54"
•
|
Use Num() to convert a string into a number. For example:
|
Num( "54" );
54
Note: Num() cannot convert non-numeric characters, so it produces a missing value.
Num( "Hello" );
.
•
|
Use Char() to convert a number into a string. For example:
|
Char( 54 );
"54"
Char( 3E3 )
"3000"
To preserve locale-specific numeric formatting in Num() or Char() output, include the <<Use Locale(1) option as shown in the following example:
Char( 42, 5, 2, << Use Locale( 1 ) );
// results in the character value "42,00" in the French locale
To look at each character in a string, use the Substr() function. This example looks for the letter “a” in the string and prints a message to the log:
ch = Substr( "alphabetic", 1, 1 ); // start and end with the first character
If( ch == "a",
Print( "First letter is a." )
);
"First letter is a."