[REPORT] problem with choose CMD
|
12-03-2016, 04:27 PM
(This post was last modified: 12-07-2016 02:23 PM by compsystems.)
Post: #1
|
|||
|
|||
[REPORT] problem with choose CMD
Hello
The logic of the following code fails, because choose must return 1 when [OK/ENTER] is pressed PHP Code: export INPUTtest0() |
|||
12-03-2016, 04:40 PM
Post: #2
|
|||
|
|||
RE: problem with choose CMD
Syntax:
CHOOSE(var, “title”, “item1”, “item2”,[…"item14"]) or CHOOSE(var,"title",{"item1"..."itemN"}) Displays a choose box with the given "title" and containing items with the strings "item1", etc. If the user chooses an object, var will be updated to contain the number of the selected object (an integer, 1, 2, 3, …); otherwise, stores zero in var if the user exits without choosing. Returns true (non zero) if the user selects an object, otherwise returns false (0). My website: ried.cl |
|||
12-03-2016, 05:05 PM
Post: #3
|
|||
|
|||
RE: problem with choose CMD
According to the help this CHOOSE cmd is correct, but it has not utility because the variable of the position returns the place of the selection, the output must be 1/0 as does INPUT CMD
Another improvement that must be made is that, it should be labeled up "Z" PHP Code: choose(currentPos,"test choose",{ "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O" }); // OK |
|||
12-03-2016, 05:33 PM
(This post was last modified: 12-03-2016 05:40 PM by StephenG1CMZ.)
Post: #4
|
|||
|
|||
RE: problem with choose CMD
Compsystems, a few words of explanation of what it is that you are trying to achieve would help greatly.
Since you have several inputs but want a 0 or 1 rather than a position... Do you want to enter (a,b,c,d) And see {0,1,0,1} for example...depending on which values the user has entered? Or something else? The fact that your example says it is OK from A to O suggests the difficulty may be related to keyboard mapping..Up to "O" the alphabet is unambiguous and items can be chosen by tapping the relevant key instead of scrolling. . After "O" that is no longer possible as the alphabet begins to overlap the numbers on the HP Prime keypad. Stephen Lewkowicz (G1CMZ) https://my.numworks.com/python/steveg1cmz |
|||
12-03-2016, 06:12 PM
Post: #5
|
|||
|
|||
RE: problem with choose CMD
(12-03-2016 05:33 PM)StephenG1CMZ Wrote: Compsystems, a few words of explanation of what it is that you are trying to achieve would help greatly. I think he wants 1 and 0 for OK and CANCEL instead of VALUE and 0 for OK and CANCEL. CHOOSE is probably using the same variable for both, I don't see the benefit of adding an extra step besides nitpicking something. Just use: Code: IF( choose(var,"title",{something,...}) ) THEN My website: ried.cl |
|||
12-03-2016, 06:27 PM
Post: #6
|
|||
|
|||
RE: problem with choose CMD
If the only problem is the test
If keypress==OK Failing because keypress is N rather than 1 On the HP Prime you can just use If keypress then Any non-zero value will pass the test. A very convenient syntax. Stephen Lewkowicz (G1CMZ) https://my.numworks.com/python/steveg1cmz |
|||
12-04-2016, 04:21 AM
Post: #7
|
|||
|
|||
RE: problem with choose CMD
(12-03-2016 05:33 PM)StephenG1CMZ Wrote: The fact that your example says it is OK from A to O suggests the difficulty may be related to keyboard mapping..Up to "O" the alphabet is unambiguous and items can be chosen by tapping the relevant key instead of scrolling. . After "O" that is no longer possible as the alphabet begins to overlap the numbers on the HP Prime keypad. Use the Alpha modifier key for keys that have both numbers and letters assigned to them. Graph 3D | QPI | SolveSys |
|||
12-05-2016, 03:28 PM
Post: #8
|
|||
|
|||
RE: problem with choose CMD
(12-04-2016 04:21 AM)Han Wrote:(12-03-2016 05:33 PM)StephenG1CMZ Wrote: The fact that your example says it is OK from A to O suggests the difficulty may be related to keyboard mapping..Up to "O" the alphabet is unambiguous and items can be chosen by tapping the relevant key instead of scrolling. . After "O" that is no longer possible as the alphabet begins to overlap the numbers on the HP Prime keypad. Well, but then the alpha search doesn't work... TW Although I work for HP, the views and opinions I post here are my own. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)