Page 1 of 1

Bug in "last" keyword?

Posted: Fri Dec 30, 2011 8:41 pm
by dunbarx
I found this in the user comments in the dictionary under the keyword "last".

To paraphrase:

Make a field with exactly three lines, two words to each line. Now do this in a button:

on mouseup
set the textStyle of word 1 of the last line of fld "yourField" to "bold" --throws an error
-- set the textStyle of word 1 of line -1 of fld "yourField" to "bold" --works
--set the textStyle of word 1 of line 3 of fld "yourField" to "bold" --works
--put word 1 of the last line of fld "yourField" --works
end mouseup

A "do" construction on the offending line does not help.

Where is this not resolving? Or is it another example of the instability in that keyword, already documented (and lamented} in the dictionary?

Craig Newman

Re: Bug in "last" keyword?

Posted: Fri Dec 30, 2011 10:00 pm
by jacque
If you remove "the" it works: set the textstyle of word 1 of last line of fld "yourField" to "bold"

I suspect the engine is interpreting "the" as refering to a custom property. It's probably a bug though.

Re: Bug in "last" keyword?

Posted: Sat Dec 31, 2011 4:05 am
by dunbarx
Jacque:

And I thought that HC was more forgiving with the optional use of "the", that LC was a bit more restrictive, requiring "the" in most cases in order to be happy. Now I find you cannot use it at all in some cases. Never occurred to me, being so skittish with LC syntax as opposed to good ol' HC.

Custom property? "the last"? Wherefore art thou, reserved words?

Happy New Year.

Craig

Re: Bug in "last" keyword?

Posted: Sat Dec 31, 2011 5:04 am
by jacque
It's funny, I'm fastidious about "the" in most cases: "the date", "the name", "the rect". Except I can't make myself use "the cursor", I don't know why. I cringe at "set the cursor to...", it has to be "set cursor to...".

Our brains are odd. Maybe the engine is part human.

Happy gnu ear 2 u 2.