 |
TerrellKl Novice
Joined: 30 Aug 2005 Posts: 49
|
Posted: 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? |
|
|
 |
Slaem Apprentice
Joined: 20 Sep 2005 Posts: 135
|
Posted: Thu Jan 12, 2006 7:52 am |
Just a guess, but would it be that #ADDITEM does not add duplicates?
|
|
|
 |
nexela Wizard

Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: 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)} |
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
 |
|
|