1 Roku BrightScript Reference Matches HD600 Software Version: 1.1.28 Matches HD2000 Software Version: 1.1.20 Palo Alto, CA USA
10 RUN .6666666865348816 Assigning Double-Precision Values Here are three ways to be sure double-precision values are stored without any trailing
11 Not including the built-in string functions, there is only one string operation - concatenation, represented by the plus symbol +. Example Progr
12 Program Statements Type Definition Assignment & Allocation Sequence of Execution (Conditional Statements) DEFINT CLEAR END IF
13 To re-dimension an array, you must first use a CLEAR statement LET variable = expression May be used when assigning values to variables. Roku Br
14 RETURN PRINT "ERROR!":STOP queen: PRINT "queen!" RETURN Ends a subroutine and returns control to the statement immediately
15 FOR I=10 TO 1 STEP -1 PRINT I; NEXT RUN 10 9 8 7 6 5 4 3 2 1 FOR I=1TO3 PRINT"OUTER LOOP" FOR J=1 TO 2 PRINT"
16 Use ON ERROR GOTO 0 to deactivate the ON ERROR. RESUME line number Terminates an error handling routine by specifying where normal execution is
17 THEN statement or line number or line label Initiates the "action clause" of an IF-THEN type statement. THEN is optional except when it
18 DATA item list Lets you store data inside your program to be accessed by READ statements. The data items will be read sequentially, starting wi
19 RESTORE Causes the next READ statement executed to start over with the first item in the first DATA statement. This lets your program re-use the
2 Table of Contents INTRODUCTION ...4 QUICK EXAMPLE..
20 Console Statements The statements described in this section let you send and receive strings and character to consoles. Currently the only conso
21 10 PRINT "PRINT STATEMENT #10 "; 20 PRINT "PRINT STATEMENT #20" RUN PRINT STATEMENT #10 PRINT STATEMENT #20 A trailing semi-c
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
23 ListDir(path) Returns a roLIST object containing the contents of the directory path specified. All files names are converted to all lowercase F
24 Built-in String Functions ASC MID CHR RIGHT INSTR STR INKEY STRING LEN VAL LEFT READASCIIFILE ASC (string) Returns the ASCII code
25 MID (string, p, [n]) Returns a substring of string with length n and starting at position p. n may be omitted, in which case the string starting
26 140 OLDS=OLD$+CHR$(CD) 150 NEXT 160 PRINT "THE DECODED MESSAGE IS" 170 PRINT OLD$
27 Built-in Arithmetic Functions BrightScript offers a wide variety of intrinsic ("built-in") functions for performing arithmetic and spec
28 LOG(x) Returns the natural logarithm of the argument, that is, loge(argument ). This is the inverse of the EXP function, so X=LOG(EXP (X)). To f
29 ERR Similar to ERL, except ERR returns a value related to the code of the error rather than the line in which the error occurred. Commonly used in
3 BUILT-IN ROKU OBJECT AND MISCELLANEOUS FUNCTIONS...22 WAIT (TIMEOUT, OBJECT)...
30 Reserved Words @ ERL ERR AND FOR POS CLEAR CLS PRINT CMD GOSUB RANDOM CONT GOTO READ DATA IF REM DEFDBL INPUT RESET DEFF
4 Introduction Roku BrightScript is a scripting language based on Basic. It is easy to learn, and when combined with Roku Objects, it allows devel
5 Line Numbers and Statement Separator BrightScript lines may have optional line numbers. For example, the following two examples of code are the sa
6 super_man$ Types All variables and values have a “type”. The type of a variable is stored along with its value. The following types are used by R
7 BrightScript> ?type(d) rotFLOAT Type Declaration Characters Character Type Examples $ String A$, ZZ$ % Integer A1%, SUM% ! Si
8 Exponentiation: A ^ B Negation: –X *, / (left to right) +, – (left to right) <, > , =, <=, >=, <> (left to right) NOT AND OR .
9 Examples: 1.234567 - float 5 - int 1.0 - float 1.0# - double 12345678900 - double 1% - int 1! - float 1# - double 1E0 – float 1D0 – d
Comments to this Manuals