You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simple extension for adding dynamic variables in AI2 and its distributions.
Blocks
Blocks
Description
Raises when any error occured.
Params
Type
error
String
Initialize a variable.
Params
Type
name
Any
value
Any
Initialize list of variables. Both list mustn't be empty. "names" and "values" must a list, and their length must be the same.
Params
Type
names
List
values
List
Returns: Any Get the value of a variable. If the variable doesn't exist, return null.
Params
Type
name
Any
Returns: List Get a list of values. The input should be a list of variable's names. If any of the variables doesn't exist, that item will be null. If the input list is empty, or any errors occurred, return an empty list.
Params
Type
names
List
Returns: List Get variables' names by its value. Return an empty list if there are no variables, or when error occured.
Params
Type
value
Any
Returns: List Get all of the variable names. Return an empty list if there are no variables, or when error occured.
Returns: List Get all of the values. Return an empty list if there are no variables, or when error occurred.
Rename a variable. If the old variable doesn't exist, error will occur.
Params
Type
oldName
Any
newName
Any
Rename a list of varibles. All list must not be empty. Length of both list must be the same. If any one of the old names doesn't exist, error will occur.
Params
Type
oldNames
List
newNames
List
Returns: Any Remove a variable and return removed value. If the variable doesn't exist, return null.
Params
Type
name
Any
Returns: List Remove list of variables and return a list of removed values. If any of variable's name doesn't exist, that item of the list will be null.
Params
Type
names
List
Remove all variables.
Returns: Boolean Check if given variable name exists. Return true if variable exists, otherwise false. Return false if an error occurred.
Params
Type
name
Any
Returns: Boolean Check if given value exists. Return true if value exists, otherwise false. Return false if an error occurred.
Params
Type
value
Any
Returns: Number (int) Return the number of variables. Return -1 if an error occurred.
Returns: Boolean Check if any variables exist. Return true if no variable exists, otherwise false. Return false if an error occurred.
Change Log
Version 2 (1.1)
Removed method code and error code; they are useless