Re: is within - a syntax bug?
On Tuesday, March 23, 2004, at 06:10 AM, [EMAIL PROTECTED] wrote: From: Doug Lerner [EMAIL PROTECTED] Subject: is within - a syntax bug? To: How to use Revolution [EMAIL PROTECTED] Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=US-ASCII This results in a syntax error that what is to the left of within is not a point: addToStatus within: the mouseLoc is within the rect of the target into withinCheck But rewriting it this way works: put the mouseLoc is within the rect of the target into withinCheck addToStatus within: withinCheck A compiler bug? doug No, it's not a compiler bug. Parsing happens left to right, so in your first statement the compiler first evaluated addStatus within: and decided there was more to evaluate before it could call addStatus. Then it evaluated the mouseLoc is within the rect of the target For explanatory purposes, let's assume the intermediate result of this statement is true. then it tried to parse addStatus within:true and so it called addStatus with within:true. And finally it tried to put the result of the addStatus call into the variable withinCheck. But, as addStatus isn't a function the whole thing failed because addStatus didn't return anything. Anytime you have a complicated expression it's better to use multiple statements (as you saw), or use parentheses to make sure the compiler does things in the order you intend. Best, -- Frank ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
is within - a syntax bug?
This results in a syntax error that what is to the left of within is not a point: addToStatus within: the mouseLoc is within the rect of the target into withinCheck But rewriting it this way works: put the mouseLoc is within the rect of the target into withinCheck addToStatus within: withinCheck A compiler bug? doug ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: is within - a syntax bug?
--- Doug Lerner [EMAIL PROTECTED] wrote: This results in a syntax error that what is to the left of within is not a point: addToStatus within: the mouseLoc is within the rect of the target into withinCheck But rewriting it this way works: put the mouseLoc is within the rect of the target into withinCheck addToStatus within: withinCheck A compiler bug? doug Hi Doug, I wouldn't call it a compiler bug : the ampersand (concatenation operator) is stronger thn the 'is within' function, so the engine interprets your version as : addToStatus (within: the mouseLoc) is within the rect of the target into withinCheck which of course creates a problem because now it doesn't have a point to check with the 'is within' operator. To avoid this, simply recode to : addToStatus within: (the mouseLoc is within the rect of the target into withinCheck) Hope this carified things a bit, Jan Schenkel. = As we grow older, we grow both wiser and more foolish at the same time. (La Rochefoucauld) __ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: is within - a syntax bug?
On Monday, March 22, 2004, at 10:28 PM, Doug Lerner wrote: This results in a syntax error that what is to the left of within is not a point: addToStatus within: the mouseLoc is within the rect of the target into withinCheck It looks like your mail may have wrapped this just to point out what is wrong. It looks to me that you left in into withinCheck in your copy and paste. Dar Scott ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: is within - a syntax bug?
On Tuesday, March 23, 2004, at 12:03 AM, Dar Scott wrote: addToStatus within: the mouseLoc is within the rect of the target into withinCheck It looks like your mail may have wrapped this just to point out what is wrong. It looks to me that you left in into withinCheck in your copy and paste. Oh, yeah, and the parentheses thing, too. -- dar ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution