Post Reply 
Help with INPUT and chekbox
05-22-2015, 10:35 AM
Post: #1
Help with INPUT and chekbox
hi,
I need to se two checkboxes in INPUT in a program.
This chunk of code doesn't work:
Code:
{flg,2,{85,2, 5}}, {beg,1, {15,1,5}}

if I check flg, is unchecked beg, and vice versa...
I will set two checkbox not two radio buttons...

help Smile

Salvo

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
05-22-2015, 12:04 PM (This post was last modified: 05-22-2015 12:05 PM by DrD.)
Post: #2
RE: Help with INPUT and chekbox
According to Help Input Form:

{var_name, real, [{pos}]} to create a checkbox control. If real is >1 then this checkbox gets pooled ...

So use the value 0 for real, then your check boxes will be able to get checked independently:

Change this: {flg,2,{85,2, 5}}, {beg,1, {15,1,5}}
to this: {flg,0,{85,2, 5}}, {beg,0, {15,1,5}}
Find all posts by this user
Quote this message in a reply
05-22-2015, 12:22 PM
Post: #3
RE: Help with INPUT and chekbox
In case my previous suggestion doesn't work for your example, here is another working fragment:

Code:

EXPORT test()
BEGIN
local mast,b,c,A;

input({ {mast,[0],{14,10,2}},
        {b,0,{37,10,1}},
        {c,0,{37,10,2}},
        {A,0,{37,10,3}} },
        "Sail Parameters",
        {"Mast","Foot","Luff","Angle"},
        {"Mast eye","Boom eye","Sail Luff","Foot to Luff Included Angle"});
END;
Find all posts by this user
Quote this message in a reply
05-22-2015, 01:42 PM
Post: #4
RE: Help with INPUT and chekbox
yeah, Dale!
it work well.

I thought that the logic was 0-1, but I had only examples with 1 or 2...

Another question, about INPUT:
I've three fields: day (textbox), month (dropbox), year (textbox):
Code:

...
{dd1,[0],{15,15,1}}, 
{mm1,{"1","2","3", "4", "5", "6", "7", "8", "9", "10", "11", "12"}, {40,15,1}}, 
{yy1,[0],{70,20,1}},
...
Why the cursor shift from dd1 to yy1, passing away mm1?
I thought a sequence like 1-2-3, not 1-3-(2?)...
There are customization to set the correct sequence?

(PS: I'm using input like this one into "Simple Interest" and "Odd period" program, to calc date difference, days for interest, and so on...)

Salvo

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
05-22-2015, 03:04 PM
Post: #5
RE: Help with INPUT and chekbox
I'm not sure. Could you post the entire INPUT() line? Most likely it has to do with the position parameters. Perhaps line length gets too long?

Also, I get a syntax error when compiling the odd_period() program (from your other thread), when run on the emulator. Does it run okay for you?
Find all posts by this user
Quote this message in a reply
05-22-2015, 03:55 PM (This post was last modified: 05-22-2015 05:38 PM by salvomic.)
Post: #6
RE: Help with INPUT and chekbox
(05-22-2015 03:04 PM)DrD Wrote:  I'm not sure. Could you post the entire INPUT() line? Most likely it has to do with the position parameters. Perhaps line length gets too long?

the long long line is this, but I must reorder some parameters (obviously the dates should be for me, Italian, dd mm yy)...
Code:

input ({ {dd1,[0],{15,15,1}}, 
{mm1,{"1","2","3", "4", "5", "6", "7", "8", "9", "10", "11", "12"}, {40,15,1}}, 
{yy1,[0],{70,15,1}},
{dd2,[0],{15,15,3}}, 
{mm2,{"1","2","3", "4", "5", "6", "7", "8", "9", "10", "11", "12"}, {40,15,3}}, 
{yy2,[0],{70,15,3}},
{pv, [0], {15,15,4}}, 
{n, [0], {40,15,4}},{r,[0],{70,15,4}},
{beg,0, {20,2,5}}, {flg,0,{80,2, 5}}
}, 
"Calc difference days", {"d1", "m1", "y1", "d2", "m2", "y2", 
"PV", "N","r%", "End","Financial"}, 
{"Day 1", "Month 1", "Year 1", "Day 2", "Month 2", "Year 2", 
"Present value", "Yearly pmt n", "Yearly rate%", 
"Begin or End", "Financial year (360)"
}, 
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0}, 
{1, 1, 2015, 1, 1, 2015, 1000, 36, 5, 1, 1} );

Quote:Also, I get a syntax error when compiling the odd_period() program (from your other thread), when run on the emulator. Does it run okay for you?

This morning I copied from my raft here in the Mac...

EDIT: now it should work. I've put in the post the version from the Prime...

Salvo

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)