Ignoring all the other serious issues, I noticed :

Rob Cozens wrote:

I change this so as to do the formatting as follows:

set the itemDelimiter to " "
repeat for each line theLine in field "test" of stack "Calendar"
if item 1 of theLine is "Sunday" then
set the textStyle of theLine to "bold"
end if
end repeat


....
BTW, one can skip setting the itemDelimiter by substituting

        if word 1 of theLine is "Sunday" then

or

        if offset("Sunday ",theLine) = 1 then

your if statement.

Actually, neither of those is equivalent to the original version (though it may be that either one is closer to what the orignal question intended).

If the text line (t) contains a TAB followed by "Sunday " followed by SPACE then
  item 1 of t      has     TABSunday
  word 1 of t    has     Sunday
whereas if the line has "Sunday" followed by TAB followed by SPACE, then
  item 1 of t      has     SundayTAB
  offset("Sunday", t)  has   1

so in both cases there is a text line which produces different results.

(Which is a shame - my suggestion was going to be
    if theLine begins with "Sunday" then ....
but that also has a subtly different meaning.)

-- Alex.

_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to