 |
darkspot Apprentice
Joined: 29 Jul 2002 Posts: 105
|
Posted: Thu Nov 03, 2005 4:34 am
Truncating a String List |
Is there some command to truncate a string list?
Easiest thing I can think of is
Code: |
#if (%numitems( @stringlist) > @truncatespot) {#for 1,%eval( %numitems( @stringlist)-@truncatespot) {#delnitem stringlist {%eval( @truncatespot+1)}}} |
is there something easier?
the stuff before and after the truncate could be large number of items in the string list, so I guess I'm just looking for something more effecient. |
|
|
 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Thu Nov 03, 2005 4:41 pm |
You could try this (which is a little shorter to type)
Code: |
#WHILE (%numitems( @stringlist) > @truncatespot) { #delnitem stringlist %eval(@truncatespot+1) }
|
or this (which should run quicker)
Code: |
#VAR Unique "~~-k-k-~~"
#NOOP %replaceitem(@Unique,@truncatespot,@stringlist)
#NOOP %match( %expandlist(@stringlist," ?? ") , "(*)@Unique*",@stringlist)
#NOOP %replace(@stringlist," ?? ","|")
|
|
|
_________________ Asati di tempari! |
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|