|
mortie Wanderer
Joined: 26 Sep 2002 Posts: 73 Location: United Kingdom
|
Posted: Tue Jan 20, 2004 2:53 pm
database formatting |
HI,
A couple of questions :-
I have a database which contains a list of mobnames with about 5/6 columns. My question is, how can i get the columns to stop bunching up in any given view? I re-adjust the column width by dragging it bigger.However, this doesnt remain fixed and when you move to another view or run a query on the database the column reverts to the smallest size again.
My second question is
I perform a %query on the database and it gives me a reasonably nice output list of each mob that meets the criteria. However, the formatting isint perfect. Is there any way to specifiy some sort of equadistant spacing?
It seems to take the spacing from the size of the columns shown in the gui.
e.g
Rec Range MobName Area Room
0 1-20 A small rat The Rats Lair A Hallway
1 1-20 A wererat The Rats Lair A Small Storage Room
2 1-20 A rat The Rats Lair A Small Storage Room
as you see its pretty bunched up, can you make it so the table looks neater? |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Tue Jan 20, 2004 4:37 pm |
1. Perhaps zMUD doesn't save these sizes. Try resizing them the way you want, and then save the database file and save the settings in zMUD too.
2. How is the formatting being done? What is the script that uses the %query function? You can probably use the %format function to get the formatting you want. |
|
|
|
mortie Wanderer
Joined: 26 Sep 2002 Posts: 73 Location: United Kingdom
|
Posted: Tue Jan 20, 2004 5:44 pm |
heya,
thx for the reply.
For question one..I tried saving both the database file and zmud settings but no luck. The database gui still reverts the columns to some pre-determined size.
Im not to bothered with the way the data is displayed through the gui as i perform the queries through the command line. So if i got that sorted i would be happy.
I said i used the %query, my apologies i am using the #query
This is the part of the script that queries and displays the output
#query ((&MobName =~ "%-2") & (&LevelRange =~ "{@mobrange|@charrange}")) all|mb
Its ideal becuase it returns exactly what i want and fast. The formatting is the only draw back.
mobname and levelrange are both text fields.
i run a command similar to this :-
searchmob 10 a small rat
the number being my level which sets up what the variables mobrange and charrange
I looked over past posts and saw that perhaps %format
could be used. I attempted to use %query instead, and saving the rec numbers it returns into a list.
I changed it to this
moblist=%query( ((&MobName =~ "%-2") & (&LevelRange =~ "{@charrange|@mobrange}")), all|mb)
#LOOP 1,%numwords( @moblist, "|") {
listrec=%word( @moblist, %i, "|")
#SH %db( @listrec, MobName) %format( "&5s", %db( @listrec, AreaName)) etc etc.
}
However, the search using %query didnt come up with any rec numbers
so i wasnt able to test to see if the format was better.
Also, i would like the information to be returned to me as fast as possible. The database will in the end be very large so any extra internal processing would slow it down more. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Tue Jan 20, 2004 11:18 pm |
Seems like %query doesn't like the =~ operator. I'll report it to see what Zugg has to say. You could use the %match function as a work-around, but this functions was added in 6.65, so only the beta version has it for now.
Also, instead of the #LOOP, you can use #FORALL. This command has the benefit that %i directly contains the current item in the stringlist. |
|
|
|
|
|
|
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
|
|