If $Teranga is set as a number, skipping the quotes in you if statement might work, as the quote implies text and not number?
Just an idea
yes - get rid of the quotes
it is text :/.. not number..
But i tried it anyway.. still didnt work :/
Ok, then maybe put each statement in brackets? Like
If [($Teranga <> "3875") or ($Teranga <> "4129") or ($Teranga <> "5367") or ($Teranga <> "5921")]
Tested.. same thing.. doesnt work :/
am really stuck on this one.. haha..
Yeah I'm not surprised, I didn't really think it would work, but you never know!
Try to verify exactly what the value(s) are in your variable $Teranga
Often you get fooled by the fact that what you expect to be in your variable is actually not, what is there.
E.g. there could be a carriage return or you might have multiply values.
Use of the debugger is invaluable in trying to figure this out.
BTW: All $var and $$var IS text strings as FileMaker can't set them to anything else. Though, FileMaker is clever enough to figure out if you put numbers into quotes or not.
My only other idea is to check carefully how you've written the variable $Teranga (capital letter?) and how it behaves in the data viewer when you run your script with the debugger. After that I'm afraid I'm running out of ideas!
Thanks Claus I didn't know that!
The $Teranga is taken from a Value List. and there isnt any spaces in between. that is checked.
Longer down in the code i use the Variable again to name the export file, and no spaces are printed then.
What the script does is that i have around 18 Terangas of these Terangas all exept the listed above need to be exported in one way and the others another..
The script simply ignores my If and runs all the script anyway. but since its not printing any spaces in ether the filename, or any of its searches. is there any way to check that ?
But then again the Value List have each Teranga on each line, can something come from there ? and how do i then remove it ? :/
i did another code test..
If [$Teranga = "3875"]
Show custome dialog "test"
and that one works.. :/ doesnt that conclude that its not any spaces or returns after ? :/
Maybe try to write your if the other way round?
If [$Teranga = "3875" or $Teranga = "4129" or $Teranga = "5367" or $Teranga = "5921"]
do something else
Might it be the "<>" not going well with "or" statements?
≠ might be worth trying as well
This is correct.
A <> 1 or A <> 2
is meaningless, since A can't be both 1 and 2 then always results true.
If use <> to exclude, need "and".
A <> 1 and A <> 2
is true case of "A is not (1 or 2)"