Listdir(path), Createobject(string), Getinterface(object, ifname) – BrightSign HD2000 BrightScript Reference Guide User Manual

Page 23: Objfun(interface, name, param1, …, paramn), Type(variable), Sleep(milliseconds)

Advertising
background image

23

ListDir(path)

Returns a roLIST object containing the contents of the directory path specified. All files names are converted
to all lowercase For example:

BrightScript> l=ListDir("/")
BrightScript> for i=1 to l.Count():print l.RemoveHead():next
test_movie_3.vob
test_movie_4.vob
test_movie_1.vob
test_movie_2.vob

CreateObject(string)

Creates a roku object of the name specified by string. Example:

sw = CreateObject("roGpioControlPort")

GetInterface(object, ifname)

Each Roku Object has one or more interfaces. This function returns a value of type “rotINTERFACE”.

Note that generally Roku Objects allow you to skip the interface specification. In which case, the appropriate
interface within the object is used. This works as long as the function names within the interfaces are unique.

ObjFun(interface, name, param1, …, paramN)

This function executes an object function. It is not normally used. Instead the shortcut “.” syntax is used.

ser = CreateObject(“roGpioControlPort”)
if = GetInterface(ser, “ifMessagePort”)
print ObjFun(if, “GetValue”)

Is the same as:
ser = CreateObject(“roSerialConsole”)
print ser.ifMessagePort.GetValue()

or simply:
print ser.GetValue()

Type(variable)

Returns the type of a variable and/or object. See the Roku Object specification for a list of types. To check
the type of an array, use one of the array elements (they will all be the same type). For example: print
type(q(0))

sleep(milliseconds)

This function causes the script to pause for the specified time, without wasting CPU cycles. There are 1000
milliseconds in one second.
Example:
sleep(1000) ‘ sleep for 1 second
sleep(200) ‘ sleep 2/10 of a second
sleep(3000) ‘ sleep three seconds

Advertising
This manual is related to the following products: