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


Joined: 10 Aug 2002
Posts: 17

PostPosted: Mon Mar 10, 2003 7:30 am   

Database and #loop
 
Has anyone else ever had trouble using #loop on database records? I have been trying to initialize the Name field of all the records in 2 different databases
I have it #dbload <database> followed by
#loop 5 {#addkey %i Name Noone}
(there's only 5 records in both of the dbs)
This also didnt work:
#dbfirst
#loop 5 {&Name=Noone;#dbnext}
I tried using #loopview but it always changed all the record numbers to 1, and I had planned on accessing them by number. I cant get anything to work, and whenever I try running the trigger, I get the "Message : Control " Has no parents window"
I dunno what this means. Anyone have any idea at all?
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Mon Mar 10, 2003 9:07 am   
 
I create a database called test and base it on the character database template.

1)
#DBLOAD test
#DBRESET
#LOOP 5 {#ADDKEY %i Name Noone}
Only issue I get is that the database starts at 0 versus 1.

#DBLOAD test
#DBRESET
#LOOP 5 {#ADDKEY %i Name Noone2}
Causes 0te to still be Noone. 1te - 5te is Noone2

2)
#LOOPVIEW {&Name=Noone3}
Changes all records correctly.
#LOOPVIEW {&Name=Noone4}
Changes all correctly again.

3)
#DBFIRST
#LOOP 5 {&Name=Noone;#DBNEXT}

Changes 0te - 4te to Noone, 5te is unaffected of course.

//

Can't seem to get it to fail. Am I doing something different?

Ton Diening
Reply with quote
Tommy2143
Beginner


Joined: 10 Aug 2002
Posts: 17

PostPosted: Mon Mar 10, 2003 4:38 pm   
 
Well, I wasnt using #dbreset, but it still does the same thing with it. It actually made stuff weirder, it ADDED a bunch of records I didnt have there before, and I'm not using #new or anything. SOmething is REAL messed up. I might try re-installing ZMud or something, and seeing if I can clear it up that way.
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