...
- 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 integer i% the value ofo.GetInt().
k=o
: Presumably k 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.
...
When a function that expects a BrightScript object as a parameter is passed an int, float, or string, BrightScript automatically creates the equivalent object.
...
roString also contains the ifStringOps interface, which provides the following:
Note | ||
---|---|---|
| ||
The function indexes of ifStringOps methods start at zero, while the function indexes of global methods start at one. |
...