Page 1 of 1

comparing strings

Posted: 09 Feb 2013 05:15
by dBlicious
If I enter 'cat' == 'cat' in monitor value, I would expect to get 1, but instead the editor crashes. Same if I enter 'cat' != 'dog'. If i do the same inside a script, it doesn't crash, but I don't get a result. Is there another way to compare strings? Is this a bug?

Thanks,
A

Re: comparing strings

Posted: 09 Feb 2013 07:43
by Macciza
Hi
Thanks for the report - Confirmed -I will forward it to be looked into . . .

Try 'cat'=='cat?1:0 - short hand version of if ? then : else . . .

In a script - decl test = 'cat'=='cat'?1:0;
Monitor.value=test;

or

decl test;
if ('cat'=='cat') test=1;
Monitor2.value=test;

If things don't go as planned, often being more verbose/explicit can help . . .

Cheers
MM

Re: comparing strings

Posted: 09 Feb 2013 09:42
by dBlicious
Thanks MM, I will check out your suggestions. Sorry for not being more detailed. I try to simplify the problem so it's easy to find and duplicate, but maybe I oversimplified. In any case, I appreciate your help!

Re: comparing strings

Posted: 09 Feb 2013 10:29
by Macciza
No wotties

The syntax given does work -
I made up a quick project to check your error and find a solution . . .

All good
MM