Re: Tell me I'm not crazy

2011-09-20 Thread Bob Sneidar
Tereza, it's my opinion that <> ought to have worked as well, as it works with other forms of non-numeric data, like strings. I think it's something that slipped by the developers. I would eventually have encountered the same thing. In fact I did encounter a similar kind of thing when checking t

Re: Tell me I'm not crazy

2011-09-20 Thread Tereza Snyder
On Sep 20, 2011, at 11:20 AM, Dave Cragg wrote: > > On 20 Sep 2011, at 16:45, Tereza Snyder wrote: > >> >> Is it crazy to assume that if "=" works, then "<>" (or in other languages, >> "!=") would also? > > Not crazy, but we know we shouldn't assume too much. Some of us don't have > six h

Re: Tell me I'm not crazy

2011-09-20 Thread Tereza Snyder
NO you cant: (from the docs) Note: Arrays in LiveCode are un-ordered. This means in particular that encoding two arrays will not necessarily produce the same result, even if the arrays had the same elements. To compare two arrays, simply use the = operator directly on them rather than encoding

Re: Tell me I'm not crazy

2011-09-20 Thread Joe Lewis Wilkins
A caveat, however; test "everything" before you rely on it. NO EXCEPTIONS! Particularly when you make major changes to the your "systems". Often that may be accomplished by merely running something that you have done previously that worked before. If you have several very different somethings to

Re: Tell me I'm not crazy

2011-09-20 Thread Dave Cragg
On 20 Sep 2011, at 16:45, Tereza Snyder wrote: > > Is it crazy to assume that if "=" works, then "<>" (or in other languages, > "!=") would also? Not crazy, but we know we shouldn't assume too much. Some of us don't have six hours of hair to lose. :-) If it is intended to be taken literall

Re: Tell me I'm not crazy

2011-09-20 Thread Andre Garzia
Tereza, No it is not crazy... can we assume that arrayencode always encode the same way? because this way you can simply arrayencode both values and compare them... andre On Tue, Sep 20, 2011 at 12:45 PM, Tereza Snyder wrote: > > Is it crazy to assume that if "=" works, then "<>" (or in other

Re: Tell me I'm not crazy

2011-09-20 Thread Tereza Snyder
Is it crazy to assume that if "=" works, then "<>" (or in other languages, "!=") would also? On Sep 20, 2011, at 10:27 AM, Robert Brenstein wrote: > On 19.09.2011 at 16:04 Uhr -0500 Tereza Snyder apparently wrote: >> Look at the docs for "="; LiveCode CAN compare arrays using "=". > > Ah, s

Re: Tell me I'm not crazy

2011-09-20 Thread Robert Brenstein
On 19.09.2011 at 16:04 Uhr -0500 Tereza Snyder apparently wrote: Look at the docs for "="; LiveCode CAN compare arrays using "=". Ah, something new learned; yes, to quote the docs: The ability to compare two arrays using = was added in version 3.5. Previously, comparing two arrays would have

Re: Tell me I'm not crazy

2011-09-19 Thread Phil Davis
On 9/19/11 1:48 PM, Tereza Snyder wrote: You CAN compare arrays for equality (see the docs for "="), but evidently not for INequality! Right. You're not crazy. That's my experience too. Phil On Sep 19, 2011, at 3:42 PM, Andre Garzia wrote: Tereza, I don't think you can compare arrays lik

Re: Tell me I'm not crazy

2011-09-19 Thread Richard Gaskin
Tereza Snyder wrote: You CAN compare arrays for equality (see the docs for "="), but evidently not for INequality! That's good to know. I had thought that all operators only worked on strings or numbers, and since attempting to get the value of an array (as opposed to the value of one of i

Re: Tell me I'm not crazy

2011-09-19 Thread Tereza Snyder
Look at the docs for "="; LiveCode CAN compare arrays using "=". I started out as has been suggested, and nearly gave up on my undo implementation because it was too cumbersome to iterate deep into a couple of elaborate arrays when I thought to check out array equality in the docs, and lo! it’s

Re: Tell me I'm not crazy

2011-09-19 Thread Dick Kriesel
On Sep 19, 2011, at 1:30 PM, Tereza Snyder wrote: > "(tTestA1 <> tTestA2)" is not the same as "not(tTestA1 = tTestA2)" when the > arrays are unequal. OK, Tereza, you're not crazy. The dictionary entry for "<>" says: "Use the <> (inequality) operator to compare two numbers or to compare two st

Re: Tell me I'm not crazy

2011-09-19 Thread Robert Brenstein
On 19.09.2011 at 15:30 Uhr -0500 Tereza Snyder apparently wrote: I recently encountered a problem implementing an undo function in a script. I needed to compare two arrays to see if any values had changed, like this: put (tArray1 <> tArray2) into sDirtyFlag so that sDirtyFlag would be true wh

Re: Tell me I'm not crazy

2011-09-19 Thread Tereza Snyder
You CAN compare arrays for equality (see the docs for "="), but evidently not for INequality! On Sep 19, 2011, at 3:42 PM, Andre Garzia wrote: > Tereza, > > I don't think you can compare arrays like that... I never tried to do so, I > always sort the keys and iterate thru them. > > andre > >

Re: Tell me I'm not crazy

2011-09-19 Thread Andre Garzia
Tereza, I don't think you can compare arrays like that... I never tried to do so, I always sort the keys and iterate thru them. andre On Mon, Sep 19, 2011 at 5:30 PM, Tereza Snyder wrote: > I recently encountered a problem implementing an undo function in a script. > I needed to compare two ar

Re: Tell me I'm not crazy

2011-09-19 Thread Bob Sneidar
I also ran into comparing arrays in this fashion. First of all, comparing arrays is cASE sENSITIVE (if I remember correctly). Secondly some normal operators like empty do not work on arrays. Arrays ALWAYS report empty! (At least the do for me). If the arrays are not terribly large, try using t