Description
The set
function is used within createButton
to create temporary variables or assign values to them. These variables can be reused in subsequent actions within the button. This is particularly useful for storing dynamic values or intermediate results.
Syntax
set(variableName, value)
Arguments
Argument | Description |
---|---|
variableName |
The name of the variable to be created or overwritten. |
value |
The value assigned to the variable (can be static or dynamically calculated). |
Return Types
The function does not have a direct return value. The value is stored in the specified variable.
Examples
Description | Formula |
---|---|
Storing a fixed value |
set("BudgetLimit", 100000) |
Calculation and storage |
set("TotalCosts", sumAll("Costs", true)) |
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
- Variable name must be unique: It must be unique within the
createButton
context. - No direct return value: The function only stores the value in the variable.
- Lifetime: Variables only exist during the execution of the button.
Comments
0 comments
Please sign in to leave a comment.