BrightSign BrightScript 3.0 Reference Manual User Manual

Page 50

Advertising
background image

45

End Function

“m” Identifier
If a function is called from an associative array, then the local variable

m is set to the associative array in which the

function is stored. If the function is not called from an associative array, then its

m variable is set to an associative array

that is global to the module and persists across calls.

The

m identifier should only be used for the purpose stated above: We do not recommend using m as a general-purpose

identifier.

Example:
sub main()
obj={
add: add
a: 5
b: 10
}

obj.add()
print obj.result
end sub

function add() As void
m.result=m.a+m.b
end function

Advertising