May 1, 200223 yr Hi to all the FMers, Very nice job on the new forum look, BTW. The question is: how do I script something like: case(field1="on@", "1", field1="tw@", "2", field1="thre@", "3", field1="f*", "4", "no number") In other words, instead of hardcoding the litterals, can I use the same wild card symbols available in Find Mode for searching? This would alliviate considering all the litteral possibilities, and hardcoding them in a calculated field. Thanks
May 1, 200223 yr Well, the way you have it you are almost entering all the information anyway as it will only return the one result But, if you want to find that text within a field and return a specific number then you could try Case( PatternCount( field1, "on"),1, PatternCount( field1, "tw"),2, PatternCount( field1, "thre"),3, PatternCount( field1, "f"),4, "") Then if it falls anyware in that field it will return the number. Is this what you want?
May 1, 200223 yr I'm not sure of you question but if you want wild cards in you scripted searchs you'd do somthing like this: Enter Find Mode[] SetField [ SearchField, "Otherfield & "*"] Perform Find
May 2, 200223 yr Just remember, if you are using Find mode in a script to enter the Filemaker find symbols, its best to use the InsertCalculatedResult. SetField relies on the data being the same format as the destination field - so for finding dates which fall within a range, for example, you should use this script: Enter Find Mode[] InsertCalculatedResult[Date, DateToText(Date1) & "..." & DateToText(Date2)] Perform Find[] A SetField step containing "DateToText(Date1) & "..." & DateToText(Date2)" would not work in this case because the result is not a date format.
May 2, 200223 yr Author I guess my question was: Can I use wild cards in the calculated fields rather than in a script, and from your answer I understand that I can not. I could write that script, and than make it run on opening the file, but that would be annoying to those that don't need to see these code fields. Thanks for your help.
Create an account or sign in to comment