Array of tConstraintDef. See Description text for details.
Function DDOConstraints Returns tConstraintDef[]
Call: | Get DDOConstraints to tConstraintDefArrayVariable |
tConstraintDef[] Constraints Get DDOConstraints of hoDD to Constraints
You can query the array of DataFlex constraints by calling Get DDOConstraints of the DDO after the constraints have been rebuilt. This returns an array of tConstraintDef types. A tConstraintDef type contains all of the information that can be provided for a single constraint. It is defined as follows:
// Struct used to DDOConstraints to return current constraints in an array Struct tConstraintDef Integer eType Integer eMode Integer iFile Integer iField String sValue Integer iOtherFile Integer iOtherField End_Struct
MatchesJumpIn = matches which is capable of a jump in, e.g., "A*"
eType determines the type of constraint and can be one of the following values:
Constrain Customer.Name GT "J"
The DataDictionary Object (DDO) filters the value of iFile and iField based on the comparison mode (eMode) and the value in sValue. This is defined with something like "Constrain File.field GT SomeValue". See eMode for information about the comparison modes. The value in sValue is evaluated when the Constrain command is executed (which occurs when Rebuild_Constraints calls OnConstrain). Therefore, this value can be a constant, a variable or an expression. Its value is determined when the constraint is built and not when the record is found.
Set Constrain_File to Customer.File_Number
The DDO relates to a parent DDO. This is usually defined with the "Set Constrain_File" interface. If can also be defined using the "Constrain File relates to ParentFile" constrain command. When this type is defined, the child table and relating from column is stored in iFile and iField and the related to parent table and column is stored in iOtherFile and iOtherField. Note that if no existing relationship is found between the two files, this constraint will not even get added to the array of constraints.
Constrain Customer.ID EQ Region.ID
This is similar to CONST_VALUE, except the value being compared will be another table.column value. This is usually defined with something like "Constrain MyFile.MyField GT SomeOtherTable.SomeColumn". The members iFile and iField define the value on the left and iOtherFile and iOtherField define the value on the right. Unlike CONST_VALUE, the value on the right is not known until the record is found.
When the record is found, the runtime will determine if the record for the right side first requires a relate. This will determine if the comparison is made before or after a relate.
Constrain Customer as (LowerCase(Left(Customer.name,1)="a"))
This is used with 'Constrain As' constraints. Typically, this is defined with something like "Constrain File as (Expression)". The runtime can provide no additional useful information about this expression, so none of the other struct members convey any useful information.
This is a legacy runtime value that should never appear. It is the same as CONST_CHILD.
eType is the find comparison mode and is used with CONST_VALUE and CONST_FIELD.
Values are:
Constant | Meaning |
---|---|
CONST_LT ( 0) | Constrain Customer.sName LT sValue |
CONST_LE (1) | Constrain Customer.sName LE sValue |
CONST_EQ (2) | Constrain Customer.sName EQ sValue |
CONST_GE (3) | Constrain Customer.sName GE sValue |
CONST_GT (4) | Constrain Customer.sName GT sValue |
CONST_NE (5) | Constrain Customer.sName NE sValue |
CONST_Matches ( 6) | Constrain Customer.sName matches "?A*" |
CONST_Contains (7) | Constrain Customer.sName contains sValue |
CONST_MatchesJumpIn (9) | Constrain Customer.sName matches "A*" |