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
rob
Novice


Joined: 12 Oct 2000
Posts: 30
Location: Australia

PostPosted: Thu Aug 22, 2002 8:49 am   

Strange Request
 
I am not sure if this can be done, I couldn't figure out how to do it anyway. If I have a datebase Variable called NewItem I normally show it via the "#SHOWDB @NewItem" command. What I currently do is when i am id'ing an item on my mud I normally grab all the information and store it in the DB Variable NewItem, then bring up a yesno window to ask whether I wish to add it to my database. What I WANT to do is bring up the yesno dialog box and show the current item in that window like #SHOWDB does in the main window i.e.

Name: Lightning Sword
Short:
Material:
... etc.

Do you wish to add this item "Yes" "No"

When i tried doing this it kept showing all the info from NewItem in one long garbled line.

Cheers
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Thu Aug 22, 2002 11:04 am   
 
This should do the trick for you, I believe:

#VAR TempVar "Import this record?"
#LOOPDB @NewItem {#VAR TempVar %concat(@TempVar,%cr,%key,": ",%val)}
#IF %yesno(@TempVar) {Import code here} {#SAY Database record not imported.}



 - Charbal
Reply with quote
rob
Novice


Joined: 12 Oct 2000
Posts: 30
Location: Australia

PostPosted: Fri Aug 23, 2002 5:31 am   
 
I tried your code and it failed to work properly. The YesNo window only is resized to about 4 lines deep and the yes no boxes are positioned over the top of the text from the @NewItem variable. Also it cuts off the first part i.e. the TempVar starts out with

Name : Lightning Sword
Short : Sword

for example and it cuts off the Name part in the YesNo window. I just tried creating a variable with the %concat function like:

#VAR TempVar %concat("Name = Lightning Sword", %cr, " Short = Sword")
Reply with quote
rob
Novice


Joined: 12 Oct 2000
Posts: 30
Location: Australia

PostPosted: Fri Aug 23, 2002 5:31 am   
 
I tried your code and it failed to work properly. The YesNo window only is resized to about 4 lines deep and the yes no boxes are positioned over the top of the text from the @NewItem variable. Also it cuts off the first part i.e. the TempVar starts out with

Name : Lightning Sword
Short : Sword

for example and it cuts off the Name part in the YesNo window. I just tried creating a variable with the %concat function like:

#VAR TempVar %concat("Name = Lightning Sword", %cr, " Short = Sword")
Reply with quote
rob
Novice


Joined: 12 Oct 2000
Posts: 30
Location: Australia

PostPosted: Fri Aug 23, 2002 6:24 am   
 
sorry about posting that other twice. I wrote this little script to demonstrate how the yesno window doesnot work properly. I would post it on the beta forum but can't seem to connect.

#VAR NewItem {}
#ADDKEY NewItem Long {Spiked Leg Plates}
#ADDKEY NewItem Names {Leg Plates}
#ADDKEY NewItem Flags {Giant_Only}
#ADDKEY NewItem Level {40}
#ADDKEY NewItem Value {1000 Copper}
#ADDKEY NewItem Material {Steel}
#VAR test {}
#LOOPDB @NewItem {#VAR test {%concat(@test %key = %val, %cr)};#YESNO @test }
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Fri Aug 23, 2002 9:27 am   
 
Sorry about that. I forgot to put in a disclaimer about it being untested although I can see what is happening now... Using carriage returns in this context essentially scrolls outside the boundaries of the %yesno box. You won't be able to have the exact same format you did with #SHOWDB but you should be able to approximate it by using commas instead (again, untested... I'll test it and update this post when I'm at a terminal with zMUD):

#VAR TempVar "Import this record? "
#LOOPDB @NewItem {#VAR TempVar %concat(@TempVar,%key,": ",%val,", ")}
#VAR TempVar %left(@TempVar,%len(@TempVar) - 2)
#IF %yesno(@TempVar) {#NEW "" @NewItem} {#SAY Database record not imported.}

As for the beta forum, all you have to do is fill out the application here and you will have instantaneous access.


 - Charbal
Reply with quote
rob
Novice


Joined: 12 Oct 2000
Posts: 30
Location: Australia

PostPosted: Fri Aug 23, 2002 11:59 am   
 
About the beta forum when I click that link I get the message:

You must be a Member to access this link

wierd seeing I am posting here.
Reply with quote
Darker
GURU


Joined: 24 Sep 2000
Posts: 1237
Location: USA

PostPosted: Fri Aug 23, 2002 4:54 pm   
 
The beta forum requires you to apply before you can see it. The application is on the main "All Forums" page.



zMUD 6 Online Help: All the power you'll ever need.
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