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
ZealousAnonymous
Wanderer


Joined: 06 Jan 2006
Posts: 70

PostPosted: Tue Jun 06, 2006 4:02 pm   

Database Problems?
 
I seem to encounter odd database problems. I have an alias that looks like so:

#va colourdb "%-2"
#va dbfindva %find( "%-2", ,%1)
#if (%numitems( @dbfindva)>30) {
#echo Matched %ansi( high, red)%numitems( @dbfindva)%ansi( high, cyan), too many!
#abort 1
}
#t+ dbfindcolour
#forall @dbfindva {
#DBGET %i
#mxp ~<color cyan>Record~:</color> ~<send "#SHOWDB %i">~<color indianred>%i</color></send>
#echo Item~: &Item&ID
#echo Desc~: &Description
#echo ShortName~: &InfoHere
#va IHRoom &RoomNumber
#mxp ~<send "#walk @IHRoom">~<color seashell>Room @IHRoom~</send>~</color> ~<color indianred>~ ~ ~[%roomname( @IHRoom)~]</color>~<color powderblue>~ ~ ~(%zonename( %roomzone( @IHRoom))~)~</color>
#echo ~
}
#t- dbfindcolour

It basically works like DBFIND [Field] [Query]

Sometimes it works sometimes it doesn't, sometimes it will give me 0 entries when I know for a fact that the query should return results. Sometimes it gives me the maximum number of database entries that I have.

Example: DBFIND ZONE THERA

will sometimes return:

Zone: NorthernWilderness

It also seems like changing the order of the fields changes the results sometimes.

Very confused!
Very confused!
Reply with quote
Glorida
Newbie


Joined: 10 Mar 2006
Posts: 7

PostPosted: Wed Jun 07, 2006 1:01 am   
 
I see a possible problem, I'm not sure if it's the entire cause, or not a cause at all, however, I'll just throw this out there.. When you #DBGET a record, it stays active in the database window, and shows up as the only record, and if you search again, it (I think, at least sometimes what I've seen) searches only thru that array, which consists simply of that one record. So what I would do, is at the end of your #FORALL loop, put in #DBRESET which will reset everything back into the normal view and put the selection at the 0 record value.

In my experiences, this has solve a few of my database problems that have shown up.
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