Hi Viktor, Perhaps it's a legacy feature from the '87 compiler where = could also signify assignment, but then again i doesn't explain the same for ==
iirc, Stephen Straley somewhere documented that for disambiguating = as comparison, instead of assignment, it is best to write the constant to be compared upon to the left of the expression, like Randy suggested just my 2 cents :-) frank ps: fixes are moving fast, wow! and thanks ----- Original Message ----- From: "Szakáts Viktor" <[EMAIL PROTECTED]> To: "Harbour Project Main Developer List." <[email protected]> Sent: Tuesday, June 24, 2008 3:10 PM Subject: [Harbour] Re: BUG?: == operator in DO CASE/IF I'd add that the same problem exists with 'IF n == 1' and 'IF n = 1' The construct starts to work in Clipper if slightly modified: 'IF ( n == 1 )' -> OK 'IF n != 1' -> OK 'IF !( n == 1 )' -> OK 'iif( n == 1, , )' -> OK Strange that such huge bug could slip into Clipper. Brgds, Viktor On 2008.06.24., at 14:01, Szakáts Viktor wrote: > Hi all, > > Here's an interesting one: > > --- code > PROC MAIN() > > LOCAL n := NIL > > DO CASE > CASE n == 1 > ? n, "eq 1" > OTHERWISE > ? n, "neq 1" > ENDCASE > > RETURN > --- > > --- Clipper 5.2 and 5.3 results > Error BASE/1070 Argument error: == > Called from MAIN(15) > > --- Harbour r8824 result > NIL neq 1 > > Brgds, > Viktor > _______________________________________________ Harbour mailing list [email protected] http://lists.harbour-project.org/mailman/listinfo/harbour _______________________________________________ Harbour mailing list [email protected] http://lists.harbour-project.org/mailman/listinfo/harbour
