fabriceN Posted April 8, 2008 Posted April 8, 2008 Hi all, I am looking for and idea to check an expression syntax off-context. I've been very disapointed by the fact that EvaluationError gives priority to runtime errors (missing field...) over syntax errors, and even more disapointed by isValidExpression which just seems to be a sub-EvaluationError (unlike its documentation, it is also sensitive to runtime errors) Still looking for an idea...
Søren Dyhr Posted April 8, 2008 Posted April 8, 2008 You might cover loose ends by this: http://www.aptworks.com/cgi-bin/calc_formatter_2v5.cgi --sd
comment Posted April 8, 2008 Posted April 8, 2008 The question is little too wide to be answered by "do this or that". In general, I would say that if you know which fields may be missing, you can assign them arbitrary values by using the Let() function around your expression.
fabriceN Posted April 8, 2008 Author Posted April 8, 2008 (edited) The point is to allow a user to type an expression (within a FileMaker database), and give a feed-back if there is a syntax error (missing parenthesis, too many parameters...). I am not interested in the runtime error (missing field, unrelated table...), because I want to be able to check this off-context. Any unknown string should not be analysed, just like variables (isValidExpression wouldn't mind if a variable used in the expression wouldn't exist) Is it more clear this way ? Thanks Edited April 8, 2008 by Guest
comment Posted April 8, 2008 Posted April 8, 2008 (edited) Is it more clear this way ? Not really, because the context is unknown. I understand that you don't care about runtime errors - but Filemaker does. So I don't see a way other than to remove runtime errors from the expression. So it comes back to this: is the user allowed to refer to ANYTHING in this expression? Or can there be a list of fields/variables that may not exist from the point-of-view of the EvaluationError(), but should be allowed anyway? Any unknown string should not be analysed That is not as simple as it sounds. For example, Filemaker makes a distinction between an unknown string such as "xyz" (Error #102) and "xyz(" (Error #1208). This is useful for flagging misspelled function names, as opposed to missing fields. Removing ANY unknown string wholesale would not be beneficial in such case. And what about quoted strings and comments? Edited April 8, 2008 by Guest
Recommended Posts
This topic is 6133 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now