AnsweredAssumed Answered

Falsy Variable Is Not Empty

Question asked by bdangler on Aug 28, 2017
Latest reply on Aug 30, 2017 by BruceRobertson

Environment: FileMaker Pro (Advanced) 15.0.x, Windows 7 Professional (64-bit)

In our system we have two tables: SupplierStatistics and SupplierReport.


SupplierStatistics is populated with the amount (and values) of categorical Supplier parts and requirements.

SupplierReport is populated from SupplierStatistics and cleared at the end of generating an Excel or printable report.


In an extend find loop in the reporting script, it extends (or starts) a foundset using a list of our suppliers. The variable $Completed contains a list of the suppliers which have existing statistics, and $Missing (generated by a Let) is a list of suppliers without existing statistics.

Example code only, not valid.


Set Variable [$~current] // The supplier to query
Set Variable [$~found]   // FoundCount prior to find


# -- Exports -- #
If [( Get ( FoundCount ) - $~found ) > 0] // If positive change to FoundCount...
     Set Variable [$Completed; Value: List ( $Completed ; $~current )]
     Set Variable [$Missing; Value:   List ( $Missing   ; $~current )]
End If


If $Missing is invoked with a single Value of "SomeDamnedFoolThing", not $Missing evaluates to 1.

If ( $Missing )
     Set Variable [$x; Value: "" /*This code will not run*/]
     Set Variable [$x; Value: "" /*This code will run*/]
End If


While I'm aware the correct approach here is to evaluate not IsEmpty ( $Missing ), 10 other people (consisting of roboticists and software engineers) and I have been equally stumped as to the behaviour behind this. This is replicable on two machines we have here in the office (both in and out of debug).


How can Text be falsy but not Empty?




EDIT (2017/08/28): Added FMP15 tag and updated environment ("FileMaker 15.0.x" -> "FileMaker Pro (Advanced) 15.0.x")

EDIT (2017/08/29): Converted Let statement into an If step for readability purposes. Reworded final paragraph to be a little more direct as to the subject matter. Many thanks to fitch for both reading and addressing the actual subject of my question.