Built-in roku object and miscellaneous functions, Pos(x), Wait (timeout, object) – BrightSign HD2000 BrightScript Reference Guide User Manual

Page 22

Advertising
background image

22

You may then enter the values all at once or one at a time. To enter values all at once, separate them by
commas. (If your string literal includes leading blanks, colons, or commas, you must enclose the string in
quotes.)

To input a string with no ? displayed, use LINEINPUT.
100 LINEINPUT A$

POS(x)

Returns a number from 0 to window width, indicating the current cursor position on the cursor. Requires a
"dummy argument" (any numeric expression).


PRINT TAB(40) POS(0) ‘

prints 40 at position 40

PRINT "THESE" TAB(POS(0)+5)"WORDS" TAB(POS(0)+5)"ARE";
PRINT TAB(POS(0)+5)"EVENLY" TAB(POS(0)+5)"SPACED"

Built-in Roku Object and Miscellaneous Functions

Roku BrightScript has integrated support for Roku Objects. These objects are how the Roku system exposes
blocks of functionality to the scripting language. For example, there are objects for receiving events (aka
messages), accessing consoles (such as the serial port), playing back video, playing audio, etc. See the
separate Roku Object specification for the details.

The following built-in functions are for manipulating Roku Objects and Miscellaneous functions.


WAIT

LISTDIR
CREATEOBJECT
GETINTERFACE
OBJFUN
TYPE
SLEEP

wait (timeout, object)

This function waits on objects that are “waitable” (those that have a MessagePort interface). It returns the
message object. If timeout is zero, “wait” will wait for ever. Otherwise, Wait will return after timeout
milliseconds if no messages are received. In this case, Wait returns a type “

rotINT32

”.


Example:

p = CreateObject("roMessagePort")
sw = CreateObject("roGpioControlPort")
sw.SetPort(p)
msg=wait(0, p)

print

type(msg) ‘ should be roGpioButton

print msg.GetInt() ‘ button number

Advertising
This manual is related to the following products: