At 15:38 Uhr -0500 02.11.1999, [EMAIL PROTECTED] wrote:
>1. Are there really big advantages to switching from the old item x 
>of line y approach?

Yes, it is faster and you dont have to care about commas or returns 
being in your values.

>What happens if you put an array into a field?

Do not do that... you can put elements of an array anywhere, but not 
entire arrays. A way to store/build arrays into/from text data is on 
the feature request list.

>Can you put a delimiter into an array?

Yes.

>What exactly is an *associative* array as opposed to a plain old array?

Just that you can use other things than numbers as indexes in your array.

>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.
>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

You did not set the wholeMatches to true, so if one line is "old" and 
another is "cold", one will be deleted!

>It seems hellish quick to me, but is it efficient?

I would do it this way:
on mouseUp
   put empty into outlist
   repeat for each line it in fld "runlist"
     if it is not among the lines of outlist then
       put it&return after outlist
     end if
   end repeat
   put outlist into fld "runlist"
end mouseUp

I guess this is even faster.

>Does it  speed things up to put the field into a variable?

Yes. Putting stuff into a field needs reformatting of the field, 
which takes time (but not so much in 2.3 any more, thanx Scott!!! 
:-))))



>3. ...
>
>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.

It is too far fetched say that everything that you do wrong is a bug 
in the software, because it is to complex to do it right. But take 
comfort in thinking a bit like that. xTalk is supposed to be the 
programming language "for the rest of us"... that is "non 
professional programmers". I am a professional programmer (which does 
not make me one of those "smarter guys", does it?), but I like 
programming in xTalk because, in order to have readable code, I don't 
have to write more comments than code like I have to in C++, Java, or 
any other language.

>We psychologists have a term for this, but sadly it has slipped my mind.

inferiority complex ;-)))


Regards
   R�diger
--------------------------------------------------------------------
| Ruediger zu Dohna   GINIT GmbH   0721-96681-63    [EMAIL PROTECTED] |
| PGP-Fingerprint: F1 BF 9D 95 57 26 48 42 FE F8 E8 02 41 1A EE 3E |
--------------------------------------------------------------------

Reply via email to