Brightsign Object Reference Manual (FW 5.1) Instrukcja Użytkownika Strona 31

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 341
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 30
23
roInt, roFloat, roString
The intrinsic types roInt32, roFloat, and roString have an object and interface equivalent. 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.
Note: If "o" is an roInt, then these statements have the following effects:
o print o: Prints o.GetInt()
o i%=o: Assigns the integer i% the value of o.GetInt()
o k=o: Presumably k is typeOmatic, so it becomes another reference to the roInt o
o o=5: This is NOT the same as o.SetInt(5). Instead it releases o, changes the type of o to roINT32 (o is
typeOmatic), 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.
Interfaces: ifInt, ifIntOps, ifFloat, ifString, ifStringOps
roInt contains the ifInt interface, which provides the following:
GetInt() As Integer
SetInt(value As Integer) As Void
Przeglądanie stron 30
1 2 ... 26 27 28 29 30 31 32 33 34 35 36 ... 340 341

Komentarze do niniejszej Instrukcji

Brak uwag