Indicator Command
Obsolete
Indicators are obsolete, with the exception of predefined indicators that already exist in the language. Among the reasons for this are the limit of 89 user-defined indicators per program and that indicators are global.
Use the Boolean command to declare Boolean variables instead, or declare properties in classes and objects. You can use the move command to set and retrieve the value of indicators.
Example:
Indicator Approved
Indicate Approved as (Company.Credit > 0)
[Approved] Begin
// add code here
End
Can be changed to:
Boolean bApproved
If (Company.Credit > 0) Move True to bApproved
Else Move False to bApproved
If (bApproved) Begin
// add code here
End
Purpose
To declare indicators.
Syntax
indicator
indicator [... indicator]
The first indicator is required. Up to nine indicators may be declared on one command line, with their names separated by spaces. Indicator names may be between 1 and 80 characters in length, must start with a letter, and may not contain spaces.
What It Does
The indicator command establishes up to nine indicators. Upon declaration, every indicator is false.
DataFlex uses indicators to determine whether to execute command lines that begin with indicators in brackets []. If the indicator is false, the command is not executed; if it is true, the command is executed. See the Indicate Command.
Indicators should be declared with the indicator command and their values set to true or false by program action before they are used to control the execution of commands.
indicator fried boiled scrambled hard
In this example, four indicators, fried, boiled, scrambled, and hard, are established. Upon execution of this command, they are all false.
Notes
-
While it is absolutely necessary to declare the other types of variables (Date, Integer, Numeric, and String), indicators may be declared without the indicator command.
indicate new_indicator as [not old_indicator] -
If
Indicator old_indicatorhad not been declared previously, this command would trigger an error at compile time, butIndicator new_indicatorwould, if it did not previously exist, be created as a result of the execution of this command. -
The main reason for declaring indicators is to make the source code clearer to anyone reading it. For that reason, we recommend that you do declare indicators with the indicator command.
-
At run time, indicators are more efficient for controlling the execution of commands than if test commands, because if tests require more processing than true/false evaluation of indicators.