Supported
The following table shows the supported PowerScript statements with examples:
Statement |
Examples |
Assignment |
a = b + 2 Note: There must not be any space between the following operators: ++, --, +=, -=, *=, /=, ^=. |
CALL |
CALL ancestorobject {controlname}::event Call super::eventname Example: Call super::clicked Note: It is supported to use the local variable AncestorReturnValue in an event of a descendant object, if the AncestorReturnValue is generated in a Call Super statement. Call windowname:: eventname Example: Call w_parent::ue_ok Call windowname`Controlname:: eventname Example: Call w_parent`dw_1::ue_retrieve |
CHOOSE...CASE |
CHOOSE CASE testexpression CASE expressionlist statementblock ... { CASE expressionlist statementblock CASE expressionlist statementblock } CASE ELSE statementblock } END CHOOSE Notes: Expressionlist can be one of the following expressions:
|
CONTINUE |
integer A=1, B=1 DO WHILE A < 10 A ++ IF A < 3 THEN CONTINUE B+=A LOOP |
CREATE |
CREATE Support creating object instances for all objects except for PowerObject object, GraphicObject object, WindowObject object, DragObject object, DrawObject object, Function_object object and SystemFunctions object. CREATE USING Support dynamically creating object instances except for:
|
DESTROY |
DESTROY DBTrans Supported:
Note: As one of the best development practices, it is strongly recommended that you use DESTROY statement. |
DO...LOOP |
Four formats of Do...Loop: Do...Until
DO UNTIL a > 15 a = (a + 1) * b LOOP
Do...While
Integer a = 1, b = 1 DO WHILE a <= 15 a = (a + 1) * b LOOP
Loop...Until
Integer a = 1, b = 1 DO a = (a + 1) * b LOOP UNTIL a > 15
Loop...While
Integer a = 1, b = 1 DO a = (a + 1) * b LOOP WHILE a <= 15
Nesting of Do...Loop statement. Example: Int li_array[100,50,200] FOR i = 1 to 100 FOR j = 1 to 50 FOR k = 1 to 200 ll_array[i,j,k]= i + j + k NEXT NEXT NEXT Nesting of Do...Loop statement and For...Next statement. Example: FOR ll_i = 5 to 25 DO UNTIL ll_j > 15 ll_j ++ LOOP ll_j = 1 NEXT |
EXIT |
DO WHILE a < 10 a ++ IF a > 3 THEN EXIT b += a LOOP |
FOR…NEXT |
Integer a=1 Integer start, end, increment ... For n=start TO end STEP increment a*=n Next
|
HALT |
IF sle_password.Text <> CorrectPassword THEN HALT CLOSE Notes:
|
IF...THEN |
IF num >= 1 THEN result = 1 ELSE result = 0 IF num >= 1 then result = 1 ELSEIF num <= -1 then result = -1 ELSE result = 0 END IF |
RETURN |
RETURN 0 |
Unsupported
The following statements are unsupported:
-
GOTO
-
THROW
-
THROWS
-
TRY...CATCH...FINALLY...END TRY