|
trasc Newbie
Joined: 16 Oct 2003 Posts: 7 Location: USA
|
Posted: Thu Jun 10, 2004 5:49 pm
#mapquery & %mapquery: bugs in the map database? |
Hi, me again...same topic, different problem!
Previously I was asking about how to use mapquery to get a list of rooms with a specific string in a specific field. Well, I got that to work with the help of some nice folks in the forum I came up with this:
--Begin script for alias 'listfav'--
short_id_list = %mapquery( "[UserStr] LIKE '%fav%'")
#show ---Quick Room List---
#FORALL @short_id_list {#SHOW vNum=%i - %roomid( %i)
--End script--
This queries the map DB and populates the variable short_id_list with the rooms it finds matching strings in the field specified. However, what the alias is NOT able to do is correct for a problem I've noticed within the results. It seems as though the #mapquery line of functions is not able to differentiate between vNum and RefNum when it reports back the results of the query.
For example, my map DB has a room with a vNum=279, but also has rooms (2 actually) with RefNum=279. So, when my query is run, the entries it reports back are rooms which do NOT have the string %fav% yet the vNum equals the RefNum.
My question is this: is there something wrong with the DB or is there something fundementally wrong with the logic I'm using to populate my list?
Thanks for any help!
-Tom |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Thu Jun 10, 2004 6:11 pm |
Zmud Maps have two diff options for roomnums the first is OBJID which is the number of the record and the second is REFNUM which is Vnum of room If your Mud doesn't allow you to see Vnums you can set up your map to use OBJID which wil make your life alot easier
Enter this once on command bar and hit enter This option is also on by default in the 7.x series for NEW maps.
#CALL %roommode(1)
and this %roomid( %i) will use the objID *which is what your mapquery is gathering I think* in place of the refnum. |
|
|
|
trasc Newbie
Joined: 16 Oct 2003 Posts: 7 Location: USA
|
Posted: Thu Jun 10, 2004 6:21 pm |
Thanks nexela! Worked like a charm! :)
I don't know what I'd do without this community.
-Tom |
|
|
|
|
|