|
Vaile Newbie
Joined: 10 May 2003 Posts: 9 Location: Columbus OH USA
|
Posted: Sat May 10, 2003 5:42 am
Saving Information in Databases |
I have a simple yet, potentially that is, complicated question. Is it possible to create a set of database aliases/triggers that would allow two windows to simultaneously save/edit/retreive data from one database? Thus far I have had no luck in my endeavor. Running 6.62.
Thanks,
Vaile |
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: Sat May 10, 2003 7:27 pm |
Yes, in window 1 open the data base
If the database opens to a Open database,
Use the Save As under the file options to input the name of the database,then save it.
If it does not open to an Open page you will see the button for New or Load,click load and chose your database.
Now that you know the name of the database you can open the second window and click the database button
If it opens to a Open database, goto file click close. you will see the New and Load database buttons after it closes.
Click the load button to load and chose the same database as the other window.
That should do it, have fun....
megamog75
Keeper of the only printable help files for Zmud. |
|
|
|
Vaile Newbie
Joined: 10 May 2003 Posts: 9 Location: Columbus OH USA
|
Posted: Sun May 11, 2003 3:14 am |
Well, I've gotten that to work. The problem isn't that I can't open them at the same time, but that when two windows have a single database open and you save the information using one, it doesn't update/refresh the information on the other one. This could be a problem if you have 8 characters opening, editting, searching, apending, deleting from one database on an ongoing/constant basis. I was working on a database system that would take a newly logged character, check the database to see if they've been entered in it already, if not it gives the choice to add. Stats, items held, items worn, items in containers, stats of the items in another database linked to the main one. Any ideas on how I could skirt the refreshing of the DB's, or make it so they refresh automatically?
Thanks,
Vaile |
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: Sun May 11, 2003 4:52 am |
Yes I believe then you want the information in the help file for:
DBLOAD
DBSAVE
DBCLOSE
Use them like so:
When a character needs to store check or delete something the have it Load the database write delete read then Save and Close, This way you will always have a updated file. Maybe DBREFREASH but I am not sure on that.
:)
megamog75
Keeper of the only printable help files for Zmud. |
|
|
|
Vaile Newbie
Joined: 10 May 2003 Posts: 9 Location: Columbus OH USA
|
Posted: Sun May 11, 2003 10:53 am |
Just curious as to why the database will not open while attempting the following alias.
#IF !%find( %char, All) {
#SHOW Works
#YESNO "Add character to DB?" {
Yes:#DBLOAD CH
#NEW All Name=%char
#DBSAVE
#DBCLOSE
}
}
I've also tried it this way:
#DBLOAD CH
#IF !%find( %char, All) {
#YESNO "Add character to DB?" {
Yes:#NEW All Name=%char
#DBSAVE
}
}
#DBCLOSE
Still to no avail. With the Database window open and at the "New Database/Load Database" screen, it never flickers. If I open the Characters database, it will create the record for %char and close it back to "New Database/Load Database" yet will not re-open it. Any help would be appreciated.
Thanks,
Vaile |
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: Sun May 11, 2003 6:03 pm |
I do not seem to have that problem.
May be you should start wih one step at a time.
Star by just havin anytrigger open the database, then check to make sure its open
once you confirme that move to step two.
step two, do a find on the database
once you get it to work put them together close the database and try the trigger agian and see if it opens and then finds.
continue to do this, adding each line individually and going into it to comfirm if you run into a problem let me know,however using this stratagy should insure that it works properly.
An example of this is the Finished Zmud script:
http://www.zuggsoft.com/forum/topic.asp?TOPIC_ID=2164&FORUM_ID=29&CAT_ID=1&Topic_Title=Realms+of+Despair+%2D%2D+Equipment+Database+Script&Forum_Title=Finished+MUD+Scripts
good luck
megamog75
Keeper of the only printable help files for Zmud |
|
|
|
Vaile Newbie
Joined: 10 May 2003 Posts: 9 Location: Columbus OH USA
|
Posted: Sun May 11, 2003 7:15 pm |
Okay.. My mind sometimes has trouble keeping up with my fingers. I've figured out the difficulty I've been having. The databases I was trying to load were in the DB folder of a different mud file than my character was connected to. Cutting them and pasting them in the correct DB folder fixed it immediately.
Thanks,
Vaile |
|
|
|
|
|