Adaptive Framework 0.9.0

script

The following is a list of functions in the category script

FunctionDescription
assignAssign a value to the innermost structured block definition of a variable. If the variable is not defined, the variable is defined in the innermost structured block. An error is thrown if not called from a list of values (statements) in a structured function.
breakThis is a special function that can be called to break out of the body of a loop. If called outside of a loop body, an error is thrown.
constDefine one or more statically scoped constants local to the current script block with a permanent value. These constants can be accessed from the current block and inner blocks, but can not be assigned a different value.
continueThis is a special function that can be called in the body of a loop function to test the condition and, if true, start evaluating the body again. If called outside of a loop body, an error is thrown.
do_whileThis creates a new structured block with a new nested variable scope. This function will evaluate a list of values (statements) at least once while a condition is true. See the related functions "break", "continue", "return" and "throw".
forThis creates a new structured block with a new nested variable scope. This function loops while condition is true. If the condition is false for the first iteration, the loop returns a null value.
foreachThis creates a new structured block with a new nested variable scope. This function will evaluate a list of values (statements) while a condition is true with initial and increment values. The condition is tested at the beginning of the loop. If the condition is false for the first iteration, the loop returns a null value.
ifEvaluate one of two different values depending on test condition.
letDeclare one or more statically scoped variable locations local to the current script block and optionally assign them an initial value. These variables can be accessed and assigned different values from the current block and inner blocks.
rethrowThis is a special function that can be called to rethrow an error inside of a catch block. If called outside of a catch body, an error is thrown.
returnReturn from the outermost structured block. If the expression of a lambda function is a block function, this will effectively return from the lambda function. If called outside of a structured block, an error is thrown.
scriptConverts value to data type script returning script result.
switchSupport for switch statement.
throwThis throws an error that can be caught by a try/catch block. An error object of object type _AdaptiveError_ will be available in the catch block. Its "id" property will be set to "throw". The other properties set based on the parameters specified and where this function is called.
tryThis creates a new structured block with a new nested variable scope. This function will evaluate the body statements. If an error is thrown and there is an optional catch, the error will be "caught" and the associated statements will be evaluated. The optional finally statements are always evaluated after the body and catch statements. See the related functions "break", "continue", "return" and "throw".
whileThis creates a new structured block with a new nested variable scope. This function will evaluate a list of values (statements) while a condition is true. The condition is tested at the beginning of the loop. If the condition is false for the first iteration, the loop returns a null value. See the related functions "break", "continue", "return" and "throw".