Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Iliev
Newbie


Joined: 20 Jun 2011
Posts: 8

PostPosted: Mon Jun 20, 2011 9:27 pm   

%querry issues, 3.34
 
I have a db, it's loaded. I have a field, called level, type is 'number'. There are several rows, with values set for the level field.

Let's say they're 1 for row 0, 2 for 1, 3 for 2. The db is called eq.

If I type #show %query(&level=1), it shows me all records 0eq|1eq|2eq. Same with &level>0

If I type #show %query(&level=2), it shows me nothing, blank line.

So what is wrong with the query ?
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Jun 21, 2011 10:52 pm   
 
The %query function (any many other functions) takes a STRING argument so you should be putting " quotes around your query, like this:
Code:
#SHOW %query("&level=1")

Otherwise CMUD tries to parse and evaluate the expression at compile time instead of at run time. Haven't testing this directly, but it should work.
Reply with quote
Iliev
Newbie


Joined: 20 Jun 2011
Posts: 8

PostPosted: Wed Jun 22, 2011 11:08 am   
 
I found that on forums, but it didn't work either :( first time I do it there's access violation error, second time there is no message at all, but the database gets kind of buggy :P can't close it, can't 'exit' it, need to close-reopen cmud.

Cmud is in c:\Program Files\, the sessions are in d:\cmud sessions.

I made a loop with dbfirst then dbnext until empty, not sure if it works fast enough but it can search the db with expressions, can't make query (# and %) work. :P
Reply with quote
Iliev
Newbie


Joined: 20 Jun 2011
Posts: 8

PostPosted: Wed Jun 22, 2011 1:05 pm   
 
dbfirst/next is kind of slow :P like a second for 15 items display
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Jun 22, 2011 4:18 pm   
 
Looks like %query broke somewhere along the way. I just tried a simple %query with my test database and I also got the access violation. And yes, after an access violation you need to exit CMUD...don't try to keep using the database.

I'll add this to the bug list. I'm not going to put a lot of work into the existing database module because it needs to be completely rewritten from scratch. But hopefully this is an easy bug to fix since it used to work in older versions of CMUD as far as I know.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Jun 22, 2011 4:20 pm   
 
Also, regarding the speed, yes the database module is extremely slow. It really isn't a database at all, which is why it needs to be re-written to use a real SQL database driver. The current database module is a straight port from zMUD and uses flat files.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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