The "not like" expression
Hello, everyone!
I was really having a hard time trying to use the "not like" expression as shown in the manual:
The code I came up with was this:
if 'OptionField' not like "OptionChoice" then
'TextField' := "Nope"
end;
... but the one above returned the following error:
Símbolo esperado: then, given: kw, not Línea 1, Columna 22
(Expected symbol: then, given: kw, not Line 1, Column 22)
After playing around with the expression, I found this other syntax:
if 'OptionField' like (not "OptionChoice") then
'TextField' := "Nope"
end;
... however, even though it didn't display any error, it just didn't do as expected either ('TextField' := "Nope"). Actually, it didn't seem to do anything.
So I played a little bit more with expressions, but couldn't come up with anything else for around an hour or two. After a cold Coke, a deep breath, and taking another deep look at the online help (https://ninox.com/en/manual/calculations/logical-functions), I realized the evaluator "not like" is not a 2-word single evaluator, but two completely different separate evaluators ("not" and "like"... and YES! Now I know that was pretty obvious with my previous attempt! (T.T), but it was 4:00AM in the morning!), so I decided to treat them properly this time and put them into different places of the sentence in order to deny the entire "like" evaluation instead, and came up with this:
if not ('OptionField' like "OptionChoice") then
'TextField' := "Nope"
end;
... (parenthesis on the code above are not necessary, they just make the point clearer)... and then... Eureka!
I'm not sure if this happened to someone else or if it will happen to anyone in the future since I think info in the manual is kinda confusing, so I decided to portray this experience here hoping it saves some time to someone else.
I really hope it helps!
Thanks for reading! Be well! (^_^)
__________________________________________________
Prepare for the worse. You might know worse. No one knows worst until upon.
Yet, pursue and hope for the best.
2 replies
-
Oh, bummer! There should be an image there... ('^_^)... anyways... you can see and download the manual here:
-
thank you! I have had the same problem befor I read your posting. The manual is unclear
Content aside
- 3 yrs agoLast active
- 2Replies
- 766Views