-
Notifications
You must be signed in to change notification settings - Fork 1
ReferenceGuide
Purpose Used to label cases in a switch or switch$ statement. |
Purpose The datablock keyword is used to declare a new datablock. A datablock
object is used in the declaration and initialization of a special set
of classes that take a datablock(s). Datablocks are created on the
server and ghosted to clients. datablock DatablockClass ( NewDatablockName : InheritDatablock ) { className = "SomeName";
datablock SimDataBlock( myDataBlock ) { newField = "Hello"; newField2 = 10; }; Here we have declared a new SimDataBlock datablock named
myDataBlock. Additionally, we have given it a new field named newField,
initialized to "Hello" and a new field named newField2 initialized to
10. The namespace calling sequence for this datablock is: myDataBlock -> SimDataBlock datablock SimDataBlock( mySecondDataBlock : myDataBlock) { className = "myDataBlock"; newField2 = 15; }; Here we have declared a new SimDataBlock datablock named
mySecondDataBlock that derives from myDataBlock. Because it is deriving
from a prior datablock, it will copy any fields that were declared
and/or initialized in the parent datablock. However, because we are
re-declaring the field newField2. The new initialization value is taken
in preference to the copied value, meaning that newField has the value
"Hello" and newField2 has the value 15. Finally, we have defined
className as myDataBlock, making the namespace calling sequence for
mySecondDataBlock: |
Purpose The default case in a switch or switch$ statement, i.e., the case that is executed if no other cases are chosen. |
Purpose The else keyword is used with the if keyword
to control the flow of a script. The general form of the well known
if-then-else construct is as follows: if (expression) { statement(s); } else { alternate statement(s); } Where the alternate statement(s) are executed if the expression evaluates to 0. |
Purpose The false keyword is used for boolean comparison and evaluates to 0. if( false == 0 ) { echo( "false evaluates to" SPC 0 ); } |
PurposeThe if keyword is used with or without the else
keyword to control the flow of a script. The general form of the well
known if-then-else construct is as follows, if (expression) { statement(s); } else { alternate statement(s); } Where the statement(s) are executed if the expression evaluates to a non-zero value. if(0) { echo( "hello" ); } else { echo( "goodbye" ); } See Also |
Purpose The new keyword is used to instantiate (create) a new copy of a conobject. A conobject is:
// New non-datablock (using) object %obj = new ScriptObject(); See Also |
Purpose The return keyword is used to return a value from a function function equal_to( %arg0 , %arg1 ) { return ( %arg0 == %arg1 ); } See Also |
Purpose The switch$ keyword is used to control the flow of a script. The general form of the switch$ statement is: switch$ ( string expression ) { case string_value0: statement(s); Execution
switch$ is intended for use ONLY with string comparisons ($=). If numeric comparisons are desired, use switch. |
Purpose The true keyword is used for boolean comparison and evaluates to 1. if(true == 1) { echo( "true evaluates to" SPC 1 ); } |