|
Amadis Newbie
Joined: 15 Jul 2004 Posts: 1
|
Posted: 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. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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. |
|
|
|
|
|