This morning I was doing some maintenance on an old solution when I ran into this ungrammatical dialog. “I’d like to give a piece of my mind to the lazy slob who wrote that”, I said to myself smugly, followed a few seconds later by, “Uh, whoops, the slob was me.” Normally, I’m pretty good about making sure my dialog text is correct with regard to plural or singular, but in this case I must’ve been feeling particularly lazy (or overly confident that users would never export only a single record).
This is such an easy problem to solve that there’s no reason not to. Simply write the dialog text calc as follows:
"Really export " & Get ( FoundCount) & " record" &
If ( Get ( FoundCount) > 1 ; "s" ; "" ) &
" to Excel?"
That’s all there is to it… unless like many developers, you hate the idea of making the FileMaker calc engine work harder than necessary — why should it have to calculate the found count twice? — in which case your syntax will more likely look like:
Let ( fc = Get ( FoundCount ) ;
"Really export " & fc & " record" & If ( fc > 1 ; "s" ; "" ) &
" to Excel?"
) // end let
In closing I’ll just add that I never want a dialog to draw attention to itself: a simple title, clear wording, no jokes, no strange button names. I know that not all developers feel the same way, but they’re entitled to be wrong once in a while. We all are.