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
godzilla1
Beginner


Joined: 14 Jul 2005
Posts: 22
Location: Budapest

PostPosted: Mon Aug 01, 2005 7:56 am   

Variable - stringlist
 
I have a variable :var1 , it contains 10 numbers. All numbers are 0, and i give them value with triggers.
example:
var1.1=5
var1.5=7
Also i decrease all value with an aliase.
#alias aliase1 {#forall @var1 {do decrease thing}}

My problem is:
If i make the variable with #var var1 {0|0|0|0|0|0|0|0|0|0}
Then i cant give value by var1.1=2 type command
If i make the var1 variable by
#var var1 {}
var1.1=0
var1.2=0
... etc.
then i cant use @forall @var1

If i give value by #var var1 {0|0|0|0|0|0|0|0|0}
then type var1.1=2;var1.2=2;var1.3=2
then manually click on the variable, select text, delete all, and save, it still have all the values (2|2|2), and #forall @var1 {#show %1} still display 10*0

Does it work as intended?
How should i do these things for work correctly? I have zmud 7.11a
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Mon Aug 01, 2005 11:45 am   
 
It looks like your confusing 2 data types, stringlist and database variables;
instead of using the syntax var1.1=5 ,which is used for assigning values to keys in a database variable,create your stringlist normally ie:
#var var1 {0|0|0|0|0|0|0|0|0|0} ,then assign values to specific positions using %replaceitem
example:
#var var1 {0|0|0|0|0|0|0|0|0|0}
#var var1 %replaceitem(5,3,@var1)

would assign 5 to the third item in the list.
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
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