About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 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
liujc
Beginner


Joined: 02 Mar 2007
Posts: 23
Location: China, BeiJing

PostPosted: Fri Mar 02, 2007 12:58 pm   

A question about the variable array
 
Since I found it's a little slow when using the database, I want to restore the needed information into a array variables. For example, store the weapons' name into: weapon1, weapon2, weapon3... and I wrote:
weapon@{id} = spear
#math id @id+1
It doesn't work. What should I do?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Mar 02, 2007 1:54 pm   
 
#var {%concat(weapon,@id)} spear
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
liujc
Beginner


Joined: 02 Mar 2007
Posts: 23
Location: China, BeiJing

PostPosted: Fri Mar 02, 2007 4:57 pm   
 
Thank a lot, it works like:
#var %concat(weapon,@id) spear
I have another question. I use the data record as the variable:
#var %concat(weapon,@id,".npc") Master
#var %concat(weapon,@id,".name") Spear
and I got:
weapon1.npc = Master and weapon1.name = Spear.
But when I wrote: #echo @{weapon@{id}.npc}, it echos nothing. What should I do?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Mar 02, 2007 5:00 pm   
 
You can try @{%concat(weapon,@id,".npc")} or the %db function.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
liujc
Beginner


Joined: 02 Mar 2007
Posts: 23
Location: China, BeiJing

PostPosted: Sat Mar 03, 2007 4:52 pm   
 
thanks!
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