global.setAttributes()
syntax: |
setAttributes(variable, attributes) |
where: |
variable - a variable identifier, name.
attributes - the attribute or attributes to be set for a variable. If more than one attribute is being set, use the or operator, "|", to combine them.
|
return: |
void.
|
description: |
This function sets the variable attributes for the parameter variable using the parameter attributes. Variables in ScriptEase may have various attributes set that affect the behavior of variables. This function has no return.
The following list describes the attributes that may be set for variables. Multiple attributes may be set for variables by combining them with the or operator. For example, the flag setting READ_ONLY | DONT_ENUM sets both of these attributes for one variable.
• DONT_DELETE • DONT_ENUM • IMPLICIT_PARENTS • IMPLICIT_THIS • READ_ONLY |
see: |
|
example: |
// The following fragment illustrates the use // of setAttributes() and the behavior affected // by the IMPLICIT_PARENTS flag. function foo() { value = 5; } setAttributes(foo, IMPLICIT_PARENTS)
var a; a.value = 4; var b; b.__parent__ = a; b.foo = foo; b.foo();
// After this code is run, a.value is set to 5. |