|
Joined: Jun 2007
Posts: 157
Vogon poet
|
OP
Vogon poet
Joined: Jun 2007
Posts: 157 |
i need someone to bit help me with this command since it is poorely described in help...
id like to know (since i work with dialogs) how to invoke input dialog that gives YES and NO button and if i click YES that script goes in one subroutine and if i click NO that script goes to another subroutine (and not just to halt the operation)
The harder I chase my dreams the more I experience the time for smiles and tears...
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
//echo -a $iif($$input(...,y,...) == $true,Yes,No)
|
|
|
|
Joined: Jun 2007
Posts: 157
Vogon poet
|
OP
Vogon poet
Joined: Jun 2007
Posts: 157 |
so if i am to do dialog operations then i would do like this?
//echo -a $iif($$input(...,y,...) == $true,did -a $dname ID Yes, did -a $dname ID No)
The harder I chase my dreams the more I experience the time for smiles and tears...
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Well, it makes no sense having two /did commands, just have one and use $iif to return Yes or No. did -a $dname ID $iif($$input(...,y,...) == $true,Yes,No)
|
|
|
|
Joined: Nov 2006
Posts: 1,559
Hoopy frood
|
Hoopy frood
Joined: Nov 2006
Posts: 1,559 |
did -a $dname ID $iif($input(...,y,...) == $true,Yes,No) Note that there is always the "close box" returning $false
|
|
|
|
Joined: Jun 2007
Posts: 157
Vogon poet
|
OP
Vogon poet
Joined: Jun 2007
Posts: 157 |
now i dont understand nothing :P
i wanted to know if $input can do this:
if pressed YES go some shit if pressed NO do another shit
:P
but not that it only works for YES and stops for NO
The harder I chase my dreams the more I experience the time for smiles and tears...
|
|
|
|
Joined: Nov 2006
Posts: 1,559
Hoopy frood
|
Hoopy frood
Joined: Nov 2006
Posts: 1,559 |
var %input = $$input(...,y,...)
if (%input == $true) { do yes stuff }
else { do no/cancel stuff } or $iif(($$input(...,y,...) == $true),do yes stuff,do no/cancel stuff) If your subroutines are comprehensive, use for example - the %var thing (store the decision for later reference) - use goto - trigger separate aliases (like the $iif thing)
Last edited by Horstl; 10/08/07 10:56 PM.
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Or $!.
noop $$input(...,y,...)
if ($!) { echo -a Yes }
else { echo -a No }
|
|
|
|
Joined: Jun 2007
Posts: 157
Vogon poet
|
OP
Vogon poet
Joined: Jun 2007
Posts: 157 |
sweet, thanks all
The harder I chase my dreams the more I experience the time for smiles and tears...
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
//echo -a $iif($$input(...,y,...) == $true,Yes,No)
In case you're interested, another way of doing this would be to use the 'v' flag and $mid: //echo -a $mid($input(...,yv,...),2) 'v' makes the input dialog return $yes or $no
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
True, I forgot about that.
|
|
|
|
|