HP Forums

Full Version: Yes or No?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What is the best way to ask Yes or No for the 50G?
back in the day we hit the Y or the N (or any other) key but now i'm thinking we can do better.
I have this but its not great:
YN.txt
Code:

%%HP: T(3)A(R)F(.);
\<< "? YES OR NO?" + { { "YES" 1. } { "NO" 0. } } 1. CHOOSE DROP
\>>
it takes an 'argument' or "text" on level one and returns a 1 for yes or 0 for no.
i'm thinking of using TMENU and GETKEY but i'm not sure how (yet).
any ideas? <<yes or no>> ...or what are you using?
user RPL please
Hello,

You can modify this:

<<
{ " " " " " " " " "CANCL" "OK" }
TMENU
DO -1 WAIT
UNTIL
{ 15.1 16.1 }
SWAP POS
IF DUP
THEN 1 -
1
ELSE 1420 .074 BEEP
END
END
0 MENU
>>

From The HP 48 Handbook by James Donnelly.

Regards,

Mark
(06-25-2014 02:20 AM)MNH Wrote: [ -> ]Hello,

You can modify this:

<<
{ " " " " " " " " "CANCL" "OK" }
TMENU
DO -1 WAIT
UNTIL
{ 15.1 16.1 }
SWAP POS
IF DUP
THEN 1 -
1
ELSE 1420 .074 BEEP
END
END
0 MENU
>>

From The HP 48 Handbook by James Donnelly.

Regards,

Mark

Mr Donnelly is good, I made this from that:

Code:

%%HP: T(3)A(D)F(.);
\<< { "YES" "" "" "" "" "NO" } TMENU
  DO -1 WAIT
  UNTIL { 16.1 11.1 } SWAP POS
    IF DUP
    THEN 1 - 1
    ELSE 1420 .1 BEEP
    END
  END 0 MENU
\>>
I just thought there might be something even better that would present a pick list and a menu and would let you use the pick list OR the menu OR the Y or N button.
This is getting a little better, takes an text or arg from stack 1, it shows a tmenu and allows menu selection or Y or N key it returns a 1 for yes or a 0 for no.
Code:
%%HP: T(3)A(D)F(.);
\<< CLLCD "?
Yes or No" + 1 DISP { "YES" "" "" "" "" "NO" } TMENU
  DO -1 WAIT
  UNTIL { 16.1 42.1 64.1 11.1 } SWAP POS
    IF DUP
    THEN 1 - 1
    ELSE 1000 .07 BEEP
    END
  END 0 MENU 1.1 - SIGN
\>>
something tells me this has all been done before but i couldn't find anything with source code.
thanks for helping, here is what I have now.
Code:
%%HP: T(3)A(D)F(.);
\<< CLLCD "?
Yes or No" + 1 DISP { "YES" "" "" "" "" "NO" } TMENU
  DO -1 WAIT
  UNTIL { 16.1 42.1 102.1 64.1 11.1 92.1 } SWAP POS
    IF DUP
    THEN 3.1 - 1
    ELSE 1500 .1 BEEP
    END
  END 0 MENU SIGN \-> X 'X>0'
\>>
takes a string then asks for Y or N, Yes or No, 0 or 1 and returns 0 for no 1 for yes.
Reference URL's