Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Mon Apr 06, 2009 3:23 pm   

[3.05] #prompt with local vars
 
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <alias name="test" copy="yes">
    <value>$t=declared
#prompt $t "Enter test val"
#SAY $t</value>
  </alias>
</cmud>

This alias can't work, because #prompt is only designed to work with global vars, as evident by the help file, which specifically says not to use @ in front of the variable name.

I'd kind of like to though.

#prompt $t "blah blah"
#if (!%iskey(@dbvar,$n)) {#addkey @dbvar $n $t} {#YESNO "Name already exists in table, would you like to replace the value?" {#addkey @dbvar $n $t}}

^ I'd like to do something along those lines without using a global var for $t
(Not that it really matters I suppose.. its not a script where execution time matters, but I've been trying to script everything using the same technique. No corner cutting.)
_________________
Athlon 64 3200+
Win XP Pro x64
Reply with quote
wrym
Magician


Joined: 06 Jul 2007
Posts: 349
Location: The big palace, My own lil world

PostPosted: Mon Apr 06, 2009 4:08 pm   
 
Have you tried using %prompt?[/code]
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Apr 06, 2009 4:17 pm   
 
%prompt would definitely be the way to go for this. Just ran this test and came up positive.

Code:
#LOCAL test
$test=%prompt("","Enter test val")
#SAY $test


Charneus
Reply with quote
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Mon Apr 06, 2009 10:52 pm   
 
Ah right, thanks.
_________________
Athlon 64 3200+
Win XP Pro x64
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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