[EMAIL PROTECTED] wrote:
>
> Three topics, several questions and a grovel.
>
> 1. About a thousand years ago I think I might have used arrays before. Then
> i got used to the rather more clunky Hypercard way. Sloth, ignorance and
> anxiety have prevented me from using arrays since playing with MC. Are there
> really big advantages to switching from the old item x of line y approach?
> What happens if you put an array into a field? Can you put a delimiter into
> an array? What exactly is an *associative* array as opposed to a plain old
> array?
Before MC, all my arrays had numeric keys - that's probably what most
folks start with, maybe because it feels easier to grasp. An associative
array is one where the keys are character strings containing any value
you want to give it. Example:
put "1/1/66" into aBirthdays[George]
put "6/14/81" into aBirthdays[Mary]
And so on.
I found a Perl tutorial that discusses associative arrays. It starts out
this way:
Associative Arrays add the final degree of complexity allowing
ordered
lists to be associated with other values. Unlike list arrays,
associative
arrays have index values that are not numbers. You do not
reference an
associative array as $associative_array_name[0] as you did for
the list
array. Instead, associative arrays are indexed with arbitrary
scalar
variables.
It's at
http://www.wdvl.com/Authoring/Scripting/Tutorial/perl_associative_arrays.html
Have fun!
Phil Davis
>
> 2. I scripted the following to strip out duplicate lines from a list field
> (that users can put lines into, and enter duplicates by mistake). It is my
> first attempt at using lineOffset and seems to work OK. With some
> trepidation I am exposing it for peer commentary. It seems hellish quick
> to me, but is it efficient? Are there any circumstances in which it might
> break? Does it speed things up to put the field into a variable?
> (appologies that there are no comments, I hope it is simple enough to be self
> evident)
>
> on mouseUp
> put field runlist into runlister
> repeat with i = 1 to the number of lines of runlister
> repeat until it =0
> get lineOffset (line i of runlister, runlister, i)
> if it is not 0 then delete line it+i of runlister
> end repeat
> put empty into it
> end repeat
> put runlister into field runlist
> end mouseUp
>
> 3. I am chastened by Scott's recent remarks about the 'me toos' on this
> list. I *promise* that I will send bug reports to [EMAIL PROTECTED] in
> future. From his comments I also gather that what is happening with the HP
> printers is now clear. Would it do any good for individuals on this list to
> also report it to HP? I work for the National Health Service in
> England....the biggest employer in Europe, that buys more than a few HP
> printers. If I can persuade our IT department to report it, HP may sit up
> and take notice. If it is worth doing, please someone, just give me enough
> information to make it look like I know what I am talking about.
>
> However, I would also like to say that part of the reluctance to report
> 'bugs' is that half the time I suspect it is me doing something wrong, and
> anyway there are lots of smarter guys on the list who will report it if it is
> a bug. We psychologists have a term for this, but sadly it has slipped my
> mind.
>
> Best wishes
>
> David Glasgow
--
Phil Davis
------------------
[EMAIL PROTECTED]