Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Martaigne
Wanderer


Joined: 05 Jan 2002
Posts: 88
Location: Atlanta, GA

PostPosted: Fri Jun 18, 2010 4:58 am   

[3.19f] #DELITEM and DELNITEM don't always work
 
I'm having serious issues with both of these commands not functioning as expected within #FORALL loops. Try looping through any stringlist and deleting one item with either command. I am trying to get it to occur consistently.
_________________
Unwritten Legends
Reply with quote
GeneralStonewall
Magician


Joined: 02 Feb 2004
Posts: 364
Location: USA

PostPosted: Fri Jun 18, 2010 5:32 am   
 
Not getting any issue using the following script:

Code:
#print ""
// test1
#print {Test1: sorted, #delitem}
#print {Setting testvar to null.}
testvar = %null
#sort testvar 1
#print {Adding 1-1000 random items to testvar.}
#loop %random( 1,1000) {
  #additem testvar %random(0, 99999)
  }
#print {There are %numitems(@testvar) items in testvar.}
#print {Looping through testvar and deleting each item.}
#forall @testvar {
  #delitem testvar %i
  }
#print {Testvar: @testvar}
#print "-------------------------"
// test2
#print {Test2: sorted, #delnitem}
#print {Setting testvar to null.}
testvar = %null
#sort testvar 1
#print {Adding 1-1000 random items to testvar.}
#loop %random( 1,1000) {
  #additem testvar %random(0, 99999)
  }
#print {There are %numitems(@testvar) items in testvar.}
#print {Looping through testvar and deleting each item.}
#forall @testvar {
  #delnitem testvar %ismember( %i, @testvar)
  }
#print {Testvar: @testvar}
#print "-------------------------"
// test3
#print {Test3: unsorted, #delitem}
#print {Setting testvar to null.}
testvar = %null
#sort testvar 0
#print {Adding 1-1000 random items to testvar.}
#loop %random( 1,1000) {
  #additem testvar %random(0, 99999)
  }
#print {There are %numitems(@testvar) items in testvar.}
#print {Looping through testvar and deleting each item.}
#forall @testvar {
  #delitem testvar %i
  }
#print {Testvar: @testvar}
#print "-------------------------"
// test4
#print {Test4: unsorted, #delnitem}
#print {Setting testvar to null.}
testvar = %null
#sort testvar 0
#print {Adding 1-1000 random items to testvar.}
#loop %random( 1,1000) {
  #additem testvar %random(0, 99999)
  }
#print {There are %numitems(@testvar) items in testvar.}
#print {Looping through testvar and deleting each item.}
#forall @testvar {
  #delnitem testvar %ismember( %i, @testvar)
  }
#print {Testvar: @testvar}
#print "-------------------------"


Quote:
Test1: sorted, #delitem
Setting testvar to null.
Adding 1-1000 random items to testvar.
There are 787 items in testvar.
Looping through testvar and deleting each item.
Testvar:
-------------------------
Test2: sorted, #delnitem
Setting testvar to null.
Adding 1-1000 random items to testvar.
There are 208 items in testvar.
Looping through testvar and deleting each item.
Testvar:
-------------------------
Test3: unsorted, #delitem
Setting testvar to null.
Adding 1-1000 random items to testvar.
There are 207 items in testvar.
Looping through testvar and deleting each item.
Testvar:
-------------------------
Test4: unsorted, #delnitem
Setting testvar to null.
Adding 1-1000 random items to testvar.
There are 906 items in testvar.
Looping through testvar and deleting each item.
Testvar:
-------------------------
Reply with quote
Martaigne
Wanderer


Joined: 05 Jan 2002
Posts: 88
Location: Atlanta, GA

PostPosted: Fri Jun 18, 2010 6:19 am   
 
I don't understand. This wasn't working a moment ago, now it is. I can't replicate the issue I was having. Apparently I need to lay off the hallucinogens.
_________________
Unwritten Legends
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net