Equinox Online Help - Language Reference - A to Z

Home

Define

Applies to
SyntaxDefine LabelName Definition
Action[Statement] Attaches a label to a statement or constant.
ScopeUsable anywhere.
Notes

This statement attaches a label to a statement or constant. LabelName is the label name and Definition is the attached statement, or constant. You can then use LabelName directly in a method to refer to Definition. Effectively, the definition is substituted wherever LabelName occurs. Definitions are particularly useful if you want to use a statement many times in a method.

CategoryDeclarations
See Also Date, Logical, Memo, Number, Procedure_EndProcedure, Public, Radio, String, Time
Example

The first example defines a constant which contains the minimum age for an insurance policy. The constant is used to test the age of the holder and spouse. To change the minimum age changes, you need only change the constant.

Define MinimumAge 40
...
if HolderAge < MinimumAge then
Alert "This person is too young For the policy"
end if

if SpouseAge < MinimumAge then
Alert "This person's spouse is too young For the policy"
end if

Definitions can be more complex and may contain other definitions. The next example uses two definitions to store the validation tests and another to hold the procedure call which processes a successful application.

Define TEST1 HolderAge < MinimumAge
Define TEST2 SpouseAge < MinimumAge
Define ProcessPolicy MakeAgreement(Today, MinimumAge)

if TEST1 Or TEST2 then
Alert "Policy applicant fails the criteria"
else
ProcessPolicy
end if