|
Tommy2143 Beginner
Joined: 10 Aug 2002 Posts: 17
|
Posted: 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? |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: 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 |
|
|
|
Tommy2143 Beginner
Joined: 10 Aug 2002 Posts: 17
|
Posted: 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.
|
|
|
|
|
|