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
TerrellKl
Novice


Joined: 30 Aug 2005
Posts: 49

PostPosted: Wed Jan 11, 2006 11:09 pm   

empty
 
#var var %null
#additem var {%item( @randomlist, %random( 1, 29))}
#additem var {%item( @randomlist, %random( 1, 29))}
#additem var {%item( @randomlist, %random( 1, 29))}
#show ~{~{ Pulled ~}~}
#wait 30
#show ~{~{ @var.1 ~}~}
#wait 30
#show ~{~{ @var.2 ~}~}
#wait 30
#show ~{~{ @var.3 ~}~}

Randomlist has 29 objects.. but every now and then the variable shows up empty.. why?
Reply with quote
Slaem
Apprentice


Joined: 20 Sep 2005
Posts: 135

PostPosted: Thu Jan 12, 2006 7:52 am   
 
Just a guess, but would it be that #ADDITEM does not add duplicates?
_________________
Show your love.
Support Zugg Software!
Donate to zugg@zuggsoft.com with PayPal Send Money.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Thu Jan 12, 2006 11:38 am   
 
Yes #ADDITEM does not add duplicate entries %additem does.

#VAR var {%additem(%item( @randomlist, %random( 1, 29)),@var)}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Jan 12, 2006 10:14 pm   
 
#ADDITEM does not, however, blank out the list variable you are trying to add the duplicate item to. The subsequent use of the variable in the #SHOW command would still show the item.

My guess is that either the @var.# syntax or the use of #WAIT is the culprit, unless of course the poster has little grasp of the english language (which would be rather hard to believe given his posting.)

If it's the @var.# syntax, my guess is that the variable isn't really an array and ZMud is somehow defaulting to datarecord behavior. Since @var.1 doesn't exist, that would explain the blankness as such things would evaluate to null and null happens to be standardly unprintable (blank space).
_________________
EDIT: I didn't like my old signature
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