Understanding IfPosted by: MaxR / Wednesday, May 16, 2007 – 5:43pm
I was performing a number script steps like: If (Contact_Phone) // perform when Contact Phone is present If (Contact_Email) // perform when Contact Email is present Normally in this scenario I would use If not IsEmpty(Contact-Phone) but was too lazy to type. The If (Contact_Phone) performs the same as for an If not IsEmpty(Contact-Phone) but not for the likes of If (Contact_Email). Both Contact_Phone and Contact_Email are text fields (no calcs, validation or the like) I ran some tests and found that if the content of the field had numeric chars anywhere within it, I'd get the right result but not when the field contained only non numeric characters. ---- How Come? ---- The test for an If() statement must result in a boolean, where zero is false and a value greater or less than zero is true. Text fields get evaluated as a number for a boolean result, thus the phone number results in a non-zero number and the email address with no numerals results in 'not true'. ------- Filed under: Scripting
|
Be Notified!Let us tell you when a new video is posted. We'll send you an email with a direct link right to your email inbox.
Make sure and whitelist (or add to your address book editor@filemakermagazine.comFileMaker Reference Tool
* $29.99 is the FMPug member price for a printed copy. 10 Most Recent Videos
|