[FREE / Open Source] Dynamic Variables - Create Dynamic Variables

DynamicVariables

Simple extension for adding dynamic variables! You can rename, get values, delete and more!

P.S. I am just having fun making this extension. You can totally achieve these by dictionary lol

Blocks

Blocks Description Method Code
Raises when any error occured. All errors explained in Errors.

Params Type
error String
errorCode int
methodCode int

N/A
Initialize/Change a variable. "name" and "value" can be anything but not nothing.

Params Type
name Any
value Any

0
Initialize/Change list of variables. Both list mustn't be empty. "names" and "values" must a list, and their length must be the same. Variable(s) is/are initialize/change in assending way.

Params Type
names List
values List
1
Returns: Any
Get value of a variable. If the variable isn't exist, return "not found".

Params Type
name Any

2
Returns: List
Get list of values. Input should be a list of variable's name. Output will a list of values in the order of input list. If any of the names isn't exist, that item will be "not found". If the input list is empty, or any error occurred, return an empty list.

Params Type
names List

3
Returns: List
Get all variable's names. Return an empty list if there's no variable, or when error occured.
4
Returns: List
Get all values. Return an empty list if there's no variable, or when error occurred.
5
Rename a variable. If the old variable doesn't exist, error will occur.

Params Type
oldName Any
newName Any

6
Rename a list of varibles. All list must not be empty. Length of both list must be the same. This method will rename variable(s) in assending order. If any one of the oldName doesn't exist, error will occur, but the oldNames before the error occurred will be renamed.

Params Type
oldNames List
newNames List

7
Returns: Any
Remove a variable. Return removed value. If variable's name doesn't exist, error will occur and return an empty string.

Params Type
name Any

8
Returns: List
Remove list of variables. Return a list of removed values. If any of variable's name doesn't exist, error will occur and return list of values that removed before the error occurred.

Params Type
names List

9
Remove all variables. If there's no variable exist, nothing will happen. 10
Returns: Boolean
Check if specific variable name exist. Return true of variable exists, otherwise false. Return false if error occurred.

Params Type
name Any

11
Returns: Number (int)
Return the number of variables. Return -1 if error occurred.
12
Returns: Boolean
Check if any variables exist. Return true if no variable exists, otherwise false. If error occurred, return false.
13

Errors

Error Code Error
0 Exception error
1 List cannot be empty
2 Length of both list must be same
3 Old variable doesn't exist

Change Log

No change log yet :wink:

Download

Version 1 com.watermelonice.DynamicVariables.aix (15.1 KB)

Or download from :github: Github

Build Extensions

Go to this directory on github for the code. Check out the wiki page if you don’t know how to compile.

16 Likes

Great extension @WatermelonIce :partying_face: keep it up :+1:

it looks like you love YusufCihan dynamic components topic interface :crazy_face:

1 Like

Because it is neat and tidy :smiley:

Btw thanks for appreciation :laughing:

2 Likes

Yes it is :wink:

You’re welcome :grin:

1 Like

Nice Extension :100:

Yep, I also like it :grin:

2 Likes

Great extension @WatermelonIce :+1:t2:

nyc extension

1 Like