Re: Scripting in Excel -> search different words in column and color them
Re: Scripting in Excel -> search different words in column and color them
- Subject: Re: Scripting in Excel -> search different words in column and color them
- From: has <email@hidden>
- Date: Fri, 25 Oct 2002 14:39:21 +0100
Paul Berkowitz wrote:
>
> I can't see using:
>
>
>
> item i of foo
>
>
>
> inherently being any simpler than using:
>
>
>
> contents of foo
>
>
The thing is - you don't have to _use_ it. you just do it once, because you
>
have to:
>
>
repeat with i from 1 to (count theList)
>
set someNiceVariable to item i of theList
>
you have to keep referring to 'contents of someNiceVariable' every bloody
>
time you want to _use_ it
Don't be silly. Whether you do or don't; the choice is entirely yours. i.e.
Here's equivalent to the above:
repeat with someNiceVariableRef in theList
set someNiceVariable to contents of someNiceVariableRef
--
Like I said before, iterating across a number range and getting list item
by index is no simpler than iterating across the list itself. (And as
human-interpreted semantics go, the latter is the clearer. But that's a
different debate, so let's not bother going there.)
The problem is that folk don't read and/or understand the manual, try it,
make random assumptions about how it works, get bitten because those
assumptions are wrong, and blame the tool instead of accepting it was their
bad and dealing with it. Such aversions then get propagated to new users by
way of lists and similar forums, and eventually you end up with an
established and broadly-accepted word-of-mouth "wisdom", despite a complete
lack of foundation to any of it.
The 'repeat with aRef in someList' structure is not a bad or flawed
language feature as your aversion to it might imply. It's actually a good
and entirely sensible one [1], and perfectly suited to the execution of
certain tasks. It's not what you might wish to term "intuitive" [2]... but
nothing in this game comes for free, and it's simply one (of several)
example where a bit of surface simplicity is traded for genuine usefulness.
Regards,
has
[1] within the confines of AS's somewhat procedural mindset
[2] though you'll likely know what I think of that word's common usage :p
--
http://www.barple.pwp.blueyonder.co.uk -- The Little Page of AppleScripts
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.