Line numbers and statement separator, Expressions, variables, and constants, Expression summary – BrightSign HD2000 BrightScript Reference Guide User Manual
Page 5: Variable names

5
Line Numbers and Statement Separator
BrightScript lines may have optional line numbers. For example, the following two examples of code are the
same:
10 hello=-1
20 if hello=-1 then print “hello there!!”
30 goto 20 ‘ loop and print forever!
hello=-1
loop_here:
if hello=-1 then print “hello there!!”
goto loop_here ‘ loop and print forever!
In BrightScript, if you wish to put multiple statements on a single line, separate them with a : (colon).
For example:
Hello=”hello there!”:print hello
Expressions, Variables, and Constants
Expression Summary
An expression is a combination of variables, constants, and functions that can evaluate to a value. The value
will also have a type.
For example:
Roku> script
BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.
BrightScript> ?5+1
6
BrightScript> ? 2.1 - 2
0.0999999
BrightScript> days=5
BrightScript> ?days+2
7
BrightScript> ?"hello"+" "+"there"
hello there
Variable Names
Variable names
• must start with an alphabetic character (a – z)
• may consist of alphabetic characters, numbers, or the symbol “_” (underscore)
• may end with an optional type designator.
• are not case sensitive
• may be of any reasonable length
• may not use a “reserved word” as the name (see appendix for list of reserved words).
For example:
a
boy5