Type declaration characters, Literals (constants) – BrightSign BrightScript 3.0 Reference Manual User Manual

Page 11

Advertising
background image

6

BrightScript> ?type(d)
String

BrightScript> d=1
BrightScript> ?type(d)
Integer

BrightScript> d=1.0
BrightScript> ?type(d)
Float

Type Declaration Characters

A type declaration may be used at the end of a variable or literal to fix its type. Variables with the same identifier but
separate types are separate variables: For example, defining

a$ and a% would create two independent variables.

Character

Type

Examples

$

String

A$, ZZ$

%

Integer

A1%, SUM%

!

Single-Precision (Float)

B!, N1!

#

Double-Precision (Double)

A#, 1/3#, 2#

Literals (Constants)

The following are valid literal types:

Type Boolean: Either

True or False

Type Invalid:

Invalid only

Type String: A string in quotes (e.g.

"This is a string")

Type Integer: An integer in hex (e.g.

HFF) or decimal (e.g. 255) format

Advertising