Tech Tip: Setting a value for a boolean variable
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: July 15, 2003
Compatibility: 4D 6.7 and later
There is a more elegant means of setting a boolean variable via a condition statement. For example,
C_BOOLEAN($myvariable)
If (([Invoices]Invoice Number=[Line Items]Invoice_ID) & ([Contacts]Contact_ID=[Invoices]Contact_ID))
$myvariable:=True
Else
$myvariable:=False
End if
can be replaced with this statement:
C_BOOLEAN($myvariable)
$myvariable:=(([Invoices]Invoice Number=[Line Items]Invoice_ID) & ([Contacts]Contact_ID=[Invoices]Contact_ID))
Whatever the value returned by the condition statement (true or false), will get assigned to the $myvariable variable.