SetIf

Takes six parameters, FieldBase, Destination, Source, Left, Comparison, Right

Usage:

FieldBase, Destination, Source, Left, Comparison, Right
[WorkWith], Destination, Source, Left, Comparison, Right

FieldBase, Destination, Source, Left, [""], [""]
[WorkWith], Destination, Source, Left, [""], [""]

Description:

Copy the value of Source to the Destination Field only if the criteria is True.

If the Source is set to "Bool" then it will assign a value of "y" to the Destination Field if the criteria is True, otherwise it will clear the Destination.

If Comparison is empty, then Right must also be empty. In this mode a simple bool test is done on Left, and if the contents of the Field has any length then it will evaluate to true. Alternatively, if the word Not is placed in front of the Left field, followed by a space (eg. "Not MyTest") then it will evaluate to true when the contents of the Field are empty.

List of Comparisons:

 Example:

SetIf   "MemTab.Person.", "Firstname", "`William", "Firstname", "=", "Bill"
SetIf   "MemTab.Person.", "IsBill", "Bool", "Firstname", "=", "Bill"

WorkWith "Job.General"           
NewFields    "Cancel"
         Build     "Cancel", "`, "Alias", "">", ""
         SetIf        "Job.General.", "Cancel", "" , "Status", "=", "`Completed"
End WorkWith

The above code block is attempting to do the following:
1. Within the "Job.General" table
2. Create "NewFields" "Cancel"
3. Build table field "Job.General.Cancel" with display button of cancel with parameter of Job.Cancel="Alias"
4. Create condition "Job.General.Status" is "=" "Completed", "Job.General.Cancel"'s value would be "".
5. End Code Block of "Job.General"