Description
The get
function is used within createButton
to retrieve the value of a variable previously defined using set
. This function is essential for processing stored intermediate values in subsequent actions of the button.
Syntax
get(variableName)
Arguments
Argument | Description |
---|---|
variableName |
The name of the variable whose value should be retrieved. |
Return Types
The function returns the value of the specified variable.
Examples
Description | Formula |
---|---|
Retrieving a fixed value |
get("BudgetLimit") |
Combination with conditions |
if(get("CurrentBudget") > get("BudgetLimit"), "Budget exceeded", "Budget is within limits.") |
Usage in a button |
createButton( "1", "Check Budget", "Check the current budget", ` set("BudgetLimit", 100000); set("CurrentBudget", sumAll("Costs", true)); if(get("CurrentBudget") > get("BudgetLimit"), "Budget exceeded!", "Budget is within limits.") `, "", "", "", "The budget has been checked.", "", "check-circle" ) |
Notes
- Retrieving non-existent variables: Returns no value if the variable has not been defined.
- Lifetime: Variables can only be retrieved during the execution of the button.
- Combination with set: Variables should always be defined with
set
before being retrieved withget
.
Comments
0 comments
Please sign in to leave a comment.