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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Never
Newbie


Joined: 22 Dec 2001
Posts: 4

PostPosted: Wed Jul 31, 2002 12:50 am   

Array Sizes
 
Is there a way to shrink an array? Say you want a list of members in your group. I was keeping names as an array, when they leave, I want to remove their names and shrink the array by 1, hmm, I suppose I could just have an arbitrary array size and then just change the values as needed...Any thoughts?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Jul 31, 2002 1:51 am   
 
Try using a list instead of an array. The related commands are ADDITEM, DELITEM, and DELNITEM. The related functions are ismember, item, numitems, additem, delitem, replaceitem, dups, and sort. I am sure you will see they are a bit more flexible while providing all the same functionality.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Jul 31, 2002 2:58 pm   
 
There is no way to shrink an array, or to remove items from it, other than redoing the entire array. Lists are much easier.

LightBulb
Senior Member
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion 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