![]() | |
#11
| |||
| |||
|
|
The cCount has the disadvantage it does not return 0 when there are no related records, but returns empty. (at least in my v8.5 adv). You have to build a wrapper to return a 1 or 0. I observed this some time ago and even built a testfile to recreate this. Are you sure, in my experience count returns 0 when there are no related records with only one exception: that its defined in a calc field with "do not evaluate if all related fields are empty" (in which case its blank) Yes I am very sure. I have built a testfile. Create two tables with a relation. Two related records and one not related. For the related record cCount < Number ; Count ( Related::rel) > returns 2 cIsempty < Number ; IsEmpty ( Related::rel) > returns 0 (False) cIsvalid < Number ; IsValid ( Related::rel) > returns 1 (True) For the not related record cCount returns nothing (Empty) cIsempty returns 1 (True) cIsvalid returns 0 (False) |
|
I would not evaluate empty as "" but use the function IsEmpty |
|
if ( IsEmpty ( count ( Related::rel ) ) ; 0 ; 1 ) which would return a 0 (False) when the relation returnd an empty count. And although filemaker does evaluate an empty as false, I would prefer to see something that can be evaluated. a 0 or False. Partly because I have people who use my databases and sometimes want to change minor things. 0 or 1 I can explain, but I fear an empty is a step to far. I already hear me explaining: No an empty is not nothing, zero is nothing. But in this case the zero is a false and not nothing...... No thanks. |
#12
| |||
| |||
|
|
But can someone refresh my memory where the two expressions yield different results? I seem to recall there actually is a case... (x = "") vs (IsEmpty(x)) |
![]() |
| Thread Tools | |
| Display Modes | |
| |