hav Wanderer
Joined: 05 Oct 2004 Posts: 61 Location: Riga, Latvia
|
Posted: Tue Oct 05, 2004 4:29 pm
%prompt default value toggle |
I have a button that prompts for variable dmode. it used to be a simple #pr dmode
@dmode has two common values ab and ab2 and a few less used ones, empty among them, so
I made a toggle for default value. I click a button and only have to hit enter to toggle.
#prompt lacks functionality, so i used %prompt. looks something like this
#VAR dmodeold @dmode
#IF (@dmode=ab) {#VAR dmode %prompt( ab2, "Enter value for: dmode")} {#IF (@dmode=ab2) {#VAR dmode %prompt( ab, "Enter value for: dmode")} {#VAR dmode %prompt( @dmode, "Enter value for: dmode")}}
#IF ((@dmodeold!="") AND (@dmode="")) {#VAR dmode @dmodeold}
it works, however as mentioned before, although not a common option, but sometimes i want the variable empty. one thing would be to assume lets say ~ means I want it empty and add #IF (@dmode="~") {#VAR dmode ""}. It's however less intuitive, when i'd need to clear variable in a hurry i'd have to remember which char is empty char. Any way to discern between clearing prompt window and pressing okay, and pressing cancel for %prompt function?
anyhow here's to hopes next version of zmud #prompt gets default value and/or %prompt gets cancel value parameters. |
|