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.
One or more characters placed within double quotation marks constitute a string. For example, these are all strings:
•
|
Use Num() to convert a string into a number. For example:
|
Num( "54" );
注意: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 );
Char( 3E3 )
To preserve locale-specific numeric formatting in Num() or Char() output, include the <<Use Locale(1) option as shown in the following example:
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:
If( ch == "a",