Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WDESIGNER and version 24.0

Local Variables of Base Type

In the Designer, it is possible to define variables that are local within an action script. These local variables are only known within the current action script.

Syntax
Code Block
languagenone
local nameOfLocalVariable = <expression>;
Semantics Declaring a local variable having the same type as the expression.
SubstitutablesnameOfLocalVariableAny given name.  
expressionExpressions are object accessors, operation calls, boolean expressions, literals, etc.
Examples
Code Block
local endPosition = myArray.count(); 
local myObject = anotherObject.myObject; 
local mylocalinteger = 1; 
local myLocalString = "empty String"; 
local anotherLocalString = myObject.myName;

This enables the compiler to apply static type checking without requiring the modeler to put the static types into the action script.

Local Variables of Complex Type

Using local, you can also create complex local variables by deriving the type from a given object.

Syntax
Code Block
languagenone
create local nameOfLocalVariable using typeOf(expression);
SemanticsCreates a local variable of complex type usable within the action script.
SubstitutablesnameOfLocalVariableAny given name.
expressionAny valid action script expression that can be evaluated to a type.
Examples
Code Block
languagenone
create local tmp using typeOf(myObject.myAttribute);

Local Arrays

Using local, you can also create a local array. The type of the array elements is derived from an expression.

Syntax
Code Block
languagenone
create local array nameOfLocalArray using typeOf(expression);
SemanticsCreates a local array using the array element declared after the equal sign.
SubstitutablesnameOfLocalArray Any given name.  
expressionAny valid action script expression that can be evaluated to a type. This is then the type of the array element.
Examples
Code Block
languagenone
 create local array myArray using typeOf(myObject.myAttribute[1]);
Panel
titleOn this Page:
Table of Contents
Panel
titleRelated Pages:

Otp
Floatingfalse

rp

Basics of the Action Script Language:

Children Display
pageBasics of the Action Script Language