This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
-
eiSi
- Halfop
- Posts: 70
- Joined: Thu Mar 07, 2002 8:00 pm
Post
by eiSi »
hi there!
I have a problem:
a list:
set list {a b c}
how to delete the entry "b", that the list only looks like this:
{a c}
thanks for any help!
-
ppslim
- Revered One
- Posts: 3914
- Joined: Sun Sep 23, 2001 8:00 pm
- Location: Liverpool, England
Post
by ppslim »
See the lreplace command.
As well as replacing one value for another, it can delete values too.
To do so, don't spacify a value to replace with.
EG
Code: Select all
set list [list a b c]
set list [lraplce $list 1 1]
The list is now "a c"
-
eiSi
- Halfop
- Posts: 70
- Joined: Thu Mar 07, 2002 8:00 pm
Post
by eiSi »
thanks I'll try!