beautypg.com

Library – BrightSign BrightScript 3.0 Reference Manual User Manual

Page 36

background image

31

cavemen.push("betty")


for each caveman in cavemen

print caveman

end for


End Function

Statement Syntax
Each line may contain a single statement. However, a colon (

:) may be used to separate multiple statements on a single

line.

Example:

myname = "fred"
if myname="fred" then yourname = "barney":print yourname

LIBRARY

LIBRARY Filename.brs


BrightScript 3.0 allows you to add your own BrightScript libraries (.brs files), which can then be utilized by your script. To
include a library, use the

LIBRARY statement in your script or at the BrightScript shell prompt. The LIBRARY statement(s)

must occur at the beginning of a script, before any other statements, functions, operators, etc.

The system locates a library by searching the directory containing the current script, as well as the

SYS:/script-lib/

directory. Note that the

Run() function does not currently change the path of a LIBRARY statement to that of the called

script (i.e. the system will continue searching the directory of the caller script). On the other hand, running a script directly
from the BrightSign shell does modify the library search path to that of the called script.