Variables, literals, and types, Identifiers, Types – BrightSign BrightScript 3.0 Reference Manual User Manual

Page 8

Advertising
background image

3

VARIABLES, LITERALS, AND TYPES

Identifiers

Identifiers are names of variables, functions, and labels. They also apply to BrightScript object methods (i.e. functions)
and interfaces (which appear after a dot "." operator). Identifiers have the following rules:

Must start with an alphabetic character (a-z).

May consist of alphabetic characters, numbers, or the underscore symbol ("

_").

Are not case sensitive.

May be of any length.

May not be a reserved word (see the

Appendix B

for a list of reserved words).

(

variables only) May end with an optional type declaration ("

$" for a string, "%" for an integer, "!" for a float, "#" for

a double).

Examples

a

boy5

super_man$

42%

Types

BrightScript supports both dynamic typing and declared types. This means that every value has a type determined at
runtime, but variables can also be instructed to always contain a value of a specified type. If a value is assigned to a
variable that has a specified type, the type of the value will be converted to the variable type if possible. If conversion is
impossible, a runtime error will occur.

Advertising