There is another option here.
If you have a multi-attribute list you can use FOR...NEXT or REMOVE or SELECT
They should all give you a similar speed.
 
However, as was pointed out, if you have a multi-valued list and use FOR...NEXT 
at least one poster believed that it does NOT keep a pointer to where you left 
off, and so REMOVE was suggested.  However if you use SELECT in this case you 
will find a similar speed to REMOVE.  SELECT does not need to operate on a 
file, it can also operate on a variable like this:
 
DONE = @FALSE
A = "DOG":@VM:"FOOD":@VM:"IS":@VM:"TASTY"
SELECT A TO MYLIST
* or alternatively SELECT A TO 1
READNEXT WORD FROM MYLIST ELSE DONE = @TRUE 
 
The first pass will put "DOG" into the WORD variable, the second will put FOOD, 
etc.
Exactly as you would intuitively think.
And it's much faster than reparsing the list on every pass.
Get jiggy with it.
 
 
Will Johnson
Fast Forward Technologies
 
 
-----Original Message-----
From: Barry Brevik <[EMAIL PROTECTED]>
To: '[email protected]' <[email protected]>
Sent: Fri, 15 Apr 2005 11:38:34 -0700
Subject: RE: [U2] Clarification on FOR...NEXT loops


>>advantage over FOR...NEXT, that things have changed (since UV 9.6?) and
>>the system is keeping track of where you are in the array in both cases.
>This functionality was added to universe at revision 7.3.1 (january of 1993

>specifically). 

I'm running UV 9.6.1.3 on Win2000.

My personal experiments indicate that there is indeed a huge speed
improvement with REMOVE over FOR/NEXT when processing a dynamic array.

If you are concerned then why not test it on your own version to see if it's
an issue?

When I have a dynamic array with multiple levels of separators, like @FM,
@VM and @SM, I find REMOVE inconvenient to use, so I cheat and go with
FOR/NEXT. Unless there are serious performance problems.

Barry
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to