isDollarDefined()
This function queries whether a specific dollar parameter exists.
Synopsis
bool isDollarDefined(string parameter);
Parameters
Parameter | Meaning |
---|---|
parameter | Name of the dollar parameter, for example, "$Motor" |
Return value
The function returns FALSE if a specific dollar parameter does not exist otherwise, TRUE.
Error
Errors (missing arguments) can be queried with getLastError().
Description
Allows you to check panels for your $ parameters and permits flexible graphics references.
Scripts directly on a panel can only know $ parameters which were passed to the panel directly, not all $ parameters used in any script of this panel.
Panel references only know default values for $ parameters if they are explicitly set in the GEDI. Panel references added with addSymbol() will instead have an empty value. The result of this is that isDollarDefined() will return false for parameters in a panel reference set with addSymbol().
Example
The following example checks the parameters and displays different debug information depending on the result of the check.
main()
{
if (isDollarDefined("$A"))
{
DebugN("$A defined");
this.text = $A;
}
else
{
DebugN("$A not defined");
this.text = "$A not defined";
}
}
Assignment
Graphics
Availability
UI