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
Amadis
Newbie


Joined: 15 Jul 2004
Posts: 1

PostPosted: Thu Jul 15, 2004 4:00 pm   

Simple DB script question
 
Lets say I have a db setup with 5 rows and two colums labled 'item' and 'value'

in this example, value is a MUD command and takes one parameter.

What I want to do is something like this. Hope it makes sense:

#DBLOAD tr

#loop 0,4 {value @i.item);#wa;@i.value = @amount}

#DBCLOSE tr

Basically using a loop, I want to repeatedly pass a string to the MUDD's value command from the db using i.item notation
and then store the result in the i.value field from the @amount var which is set from a trigger.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jul 15, 2004 5:33 pm   
 
#AL getinfo {
#DBLOAD tr
#DBFIRST
#VAR tr {}
#T+ tr
value &Item
}
#CLASS tr disable
#TR {^(%n)} {
#DBPUT %rec.Num Value %1
#VAR amount %1
#DBNEXT
#IF (%rec) {value &Item} {#T- tr}
}
#CLASS 0
#T- tr

Should work, but mostly untested. The trigger pattern will need modification to match the output of the 'value' command.
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
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