 |
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: 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 |
|
|
 |
wrym Magician
Joined: 06 Jul 2007 Posts: 349 Location: The big palace, My own lil world
|
Posted: Mon Apr 06, 2009 4:08 pm |
Have you tried using %prompt?[/code]
|
|
|
|
 |
charneus Wizard

Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: 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 |
|
|
|
 |
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: Mon Apr 06, 2009 10:52 pm |
Ah right, thanks.
|
|
_________________ Athlon 64 3200+
Win XP Pro x64 |
|
|
 |
|
|
|