Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Deleting elements from a block

 [1/3] from: learned::talentsinc::net at: 26-Sep-2001 13:29


Thanks for the assist on the CSV all, I actually managed it by just appending a comma to each element before writing the block to a file (deleting the tail of course). I am quickly learning to love this language. One more question though. If I have a block of say 4 elements, how can I delete JUST the 3rd element? --- G. Edw. Learned - [learned--talentsinc--net] (Never apply a Star Trek Solution to a Babylon Five Problem)

 [2/3] from: greggirwin:starband at: 26-Sep-2001 13:29


<< If I have a block of say 4 elements, how can I delete JUST the 3rd element? >> Remove operates on the current position in the series. To specify that, you can use at.
>> tmp: [1 2 3 4]
== [1 2 3 4]
>> remove at tmp 3
== [4]
>> tmp
== [1 2 4] Make note, also, of what is returned to you when you use remove. --Gregg

 [3/3] from: al:bri:xtra at: 27-Sep-2001 7:24


G. Edw. Learned wrote:
> If I have a block of say 4 elements, how can I delete JUST the 3rd
element?
>> block: [a b c d]
== [a b c d]
>> remove at block 3
== [d]
>> block
== [a b d] Andrew Martin ICQ: 26227169 http://zen.scripterz.org