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
jfields29
Newbie


Joined: 16 Jun 2006
Posts: 9

PostPosted: Thu Mar 29, 2007 11:13 am   

Couple DB Lookup Problems
 
First off, i'm pretty sure I can change the "force character" to something other than ~ but I would rather not due to a standard that is on my favorite mud.
zstat Tiamat
Code:
#VAR ZoneStats {%query( &Zone =~~ %1, All)}
#FORALL @ZoneStats {lookup %db(%i,Name)}


returns all items in my equipment db that have the word Tiamat in the Zone field.

This generates a syntax error, but works, I would like to resolve the syntax error somehow without changing the functionality of ~

Added Periods to show the place, due to formatting on website here, it's the 2nd ~ if it doesnt look right to you.
Quote:

#VAR ZoneStats {%query( &Zone =~~ %1, All)}
.......................................................^ syntax error

Second

Using the same alias base, I would like to change it to work something like this:

lstat str
Code:
#VAR ZoneStats {%query( &{%1} != 0 & &{%1} != %null, All)}
#FORALL @ZoneStats {lookup %db(%i,name)}


would return all items that have %1 !%null and != 0

Third

is there anyway to make the expressions dynamic as well?

what I'm really looking to do is take a tell like find maxint hp
which would return all items that have maxint and hp....
kind of an in game query builder without having to really code once it's done.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Mar 29, 2007 11:32 pm   
 
What are you trying to do in the variable when you are using =~~? My guess is that ZMud is mistaking that for the =~ pattern-matching operator, which allows you to turn an #IF into a #TRIGGER (sort of).
_________________
EDIT: I didn't like my old signature
Reply with quote
jfields29
Newbie


Joined: 16 Jun 2006
Posts: 9

PostPosted: Fri Mar 30, 2007 12:24 am   
 
its doing a match on %1, because i have Tiamat (R) Tiamat (Q) and Tiamat....
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