Panel | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
ON THIS PAGE
|
The intrinsic types roInt32 Int32
, roFloat, and roString have an Float
, and string
have object and interface equivalentequivalents. These are useful in the following situations:
- An object is needed instead of a typed value. For example, roList maintains a list of objects.
- If any object exposes the ifInt, ifFloat, or ifString interfaces, that object can be used in any expression that expects a typed value. For example, an roTouchEvent can be used as an integer whose value is the userid of the roTouchEvent.
If "o" is of type roInt, then these statements will have the following effects:
print o
: Prints the value ofo.GetInt()
i%=o
: Assigns the integeri%
the the value ofo.GetInt().
k=o
: Presumablyk
is is automatically typed, so it becomes another reference to the roInto.
o=5
: This is NOT the same aso.SetInt(5)
. Instead it releaseso
, changes the type ofo
to roINT32 (o
is automatically typed), and assigns it to 5.
...