Subscribe Bookmark RSS Feed

Small Bug in my Radio Box Script

restonian

Community Trekker

Joined:

Jun 8, 2012

My Radio Box script is:
Panel Box("Pick a record type", rbox = Radio Box( {"CLA", "CLD", "CNT", "FN2", "FRA", "MDB", "MDC","MIS", "UTI", "VLR" },

rb = rbox << Get Selected ),

Problem: If the user deosn't make a selection, that is, leaves the Radio Box at the default "CLA" ,  the variable rb is blank. If the user selects any other record type from the list,  the correct value is assigned to rb.

Thanks!

Rob in Reston

1 ACCEPTED SOLUTION

Accepted Solutions
bthaby1

Community Trekker

Joined:

Feb 23, 2012

Solution

Try setting it on the first pass. .   rb = rbox << set(1);

See example below.

getrb = expr(

rb = rbox << Get Selected;

show(rb);

);

rb = "";

show(rb);

NewWindow("test",

  PanelBox("Pick a record type", rbox = RadioBox({"CLA", "CLD", "CNT", "FN2", "FRA", "MDB", "MDC", "MIS", "UTI", "VLR"},getrb),

  rb = rbox << set(1);

  rb = rbox << Get Selected;

  show(rb);

  );

);

3 REPLIES
bthaby1

Community Trekker

Joined:

Feb 23, 2012

Solution

Try setting it on the first pass. .   rb = rbox << set(1);

See example below.

getrb = expr(

rb = rbox << Get Selected;

show(rb);

);

rb = "";

show(rb);

NewWindow("test",

  PanelBox("Pick a record type", rbox = RadioBox({"CLA", "CLD", "CNT", "FN2", "FRA", "MDB", "MDC", "MIS", "UTI", "VLR"},getrb),

  rb = rbox << set(1);

  rb = rbox << Get Selected;

  show(rb);

  );

);

restonian

Community Trekker

Joined:

Jun 8, 2012

Thanks bthaby, it worked liked a charm.

bthaby1

Community Trekker

Joined:

Feb 23, 2012

Your welcome.