HP Forums
Yes or No? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: Yes or No? (/thread-1707.html)



Yes or No? - CosmicTruth - 06-25-2014 12:27 AM

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


RE: Yes or No? - MNH - 06-25-2014 02:20 AM

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


RE: Yes or No? - MNH - 06-25-2014 03:01 AM

See also https://groups.google.com/forum/#!searchin/comp.sys.hp48/key/comp.sys.hp48/NCSFhXEoQi0/ZBbrmi81DtMJ.


RE: Yes or No? - CosmicTruth - 06-25-2014 11:43 AM

(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.


RE: Yes or No? - CosmicTruth - 06-25-2014 10:41 PM

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.


RE: Yes or No? - CosmicTruth - 06-26-2014 02:42 AM

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.