|
dime Novice
Joined: 15 Dec 2002 Posts: 35
|
Posted: Tue Jun 03, 2003 5:33 pm
reading then deleting from a list |
i'd like to know if there's a way to read and then delete a name from a list of possible names...
either 1. i have a variable called names {namea|nameb|namec|named} and i can have a script call a name from the variable and then remove it from the list...
or 2. i have a file 1 {names.txt} and i read 1 1 and again, have it delete that specific line after i use the name..
thanks |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Jun 03, 2003 6:10 pm |
Yes. The list variable would be easier. You can delete items from a list using #DELITEM , %delitem, or #DELNITEM as the situation calls for.
#DELITEM temp1 test1
#VAR temp1 %delitem( "test1", @temp1)
#DELNITEM temp1 1
You can get a particular item (the first item, for instance) from a list using %item.
#SAY %item( @temp1, 1)
You can also use %pop to retrieve and delete the first item from a list variable.
#SAY %pop( temp1)
LightBulb
Advanced Member |
|
|
|
dime Novice
Joined: 15 Dec 2002 Posts: 35
|
Posted: Tue Jun 03, 2003 6:26 pm |
thanks.. was having a hard time finding that.. ended up with a script to use #tab and #untab to create lists, write to log files and then pick random names from the text files..
btw, %pop is a new feature? since which version? i'd like the script i'm working on to be backwards compatible to at least 6.16 |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Tue Jun 03, 2003 9:55 pm |
%pop first appeared in version 6.22 or so off the top of my head.
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Jun 04, 2003 12:32 am |
You can look it up in the Version History.
LightBulb
Advanced Member |
|
|
|
|
|