PRODUCT |

|

|
|
|

|
|
|
|
|
|
|
|
|
FAQ |
|
|

|
|
|
|
|
|
|
|
|
|
LEARN SCRIPTING |
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SAMPLE SCRIPTS |
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HELP / DOCUMENTATION |
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
Help Page - conversion
( Some help pages may not display correctly in html because those help pages may have sample code in them, part of which may be mis-interpreted as html tags.
All help pages, including this help page, are available in biterScripting with the help command. )
|
|
|
System Feature
conversion
Purpose
Rules for coverting one data type to another
Syntax
These type conversions are performed automatically.
There is no explicit syntax.
Description
When variables and constants of various types are intermixed in expressions,
all types are converted to the type of highest operability.
The following list shows the operability order.
real <----------- Highest operability
int
string
bool <----------- Lowest operability
The following chart shows how the automatic conversion is performed.
From To
------ ------------------------------------------------------------------------------------------------------------------------------
real int string bool
--------------- --------------- --------------- ---------------
real - Not applicable Not applicable Not applicable
int .0 is added to - Not applicable Not applicable
value
string 0.0 if string is 0 if string is - Not applicable
empty, else empty, else 1
1.0
bool 0.0 if false, 0 if false, "0.0" if false, -
else 1.0 else 1 else "1.0"
Restrictions
The above chart representations automatic conversions that are performed
during evaluation of an expression that contains intermixed types.
For conversions that are represented as 'Not applicable' in the above
chart, automatic conversion is not possible. These conversions must be
made explicitly using one of the make functions - see help page on make.
Valid Examples
var int i
var real x
set $i=5
set $x=10.0
if ($i < $x)
...
$i will be converted to real during comparison.
Invalid Examples
var int i
var real x
if ( ( $x ) AND ( $i < 7 ) )
...
Will produce an error, since operator AND operates only on type bool.
variable x is not of type bool, but of type real. Operator AND can not operate
on data type real, and an automatic conversion is not possible from type real
to type bool.
See Also
var
constant
make
makebool
makestr
makeint
makereal
|
|
|
© 2008-2012, biterScripting.com. All rights reserved.
biterScripting, biterScript, biterBrowser, biterMobile, biterScripting.com, FVA (Forward Variable Assignment) are trademarks of biterScripting.com. Is it biterScripting-compatible ? is a service mark of biterScripting.com.
Explorer, Unix, Windows are trademarks, service marks or other forms of intellectual property of their respective owners.
|
|