Why does ? return True (mostly)

Discussion created by Ben on Feb 17, 2019
Latest reply on Feb 20, 2019 by Ben

It is known that a result of ? returns True in Filemaker.

Can anyone explain why this is a good thing?


To me it seems unhelpful, for example if there is a possibility of GetAsBoolean(x) returning "?" then normally I would consider this a False result - so I have to trap for "?" as a result, in which case I might end up with something like Case( x = "?" or x = 0 ; false ; true) - so I can't use GetAsBoolean().


I don't know a case where I would want a "bad" result to return True. Maybe that's just me.


Interestingly any other character returns False - eg. GetAsBoolean("!") or GetAsBoolean("<") - what is so special about "?" in this case?


Finally - As GetAsBoolean("?") does return True why does the Field Layout Data Formatting when set to Format: Boolean not return True? Here, on the layout it returns "?" - which seems inconsistent.


Why can't GetAsBoolean() return 1,0 or "?" ? [obviously that's not very Boolean!]


Any thoughts on this would be appreciated. In a nutshell I am trying to work out why I am too stupid to understand why a result of "?" being evaluated as True is useful behaviour.



Added later ( I should have included this originally):


According to FileMaker Help:


Returns 1 (true) if data converts to a non-zero numeric value or a container field holds data; otherwise, returns 0 (false).

FileMaker Pro 17 Advanced Help

perhaps it is just that the help page needs updating?