The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Is there a way to input a multi-selection-checkbox of arbitrary length? (SOLVED)
11-09-2015, 06:08 PM (This post was last modified: 08-23-2018 10:25 PM by StephenG1CMZ.)
Post: #1
Is there a way to input a multi-selection-checkbox of arbitrary length? (SOLVED)
In CHOOSE, I can choose just one from an arbitrary list using:
ASTEROIDS:={"1", "2",..." n"};
CHOOSE(CHS,"",ASTEROIDS);

But what I want is to able to select more than one, so that I could select several for plotting.

INPUT allows multiple items to be selected from check boxes, but the help seems to assume you know how many check boxes you have, and each is associated with a variable.
Using a list variable with check boxes compiles, but gives a run time error:
Code:


 EXPORT BS()
 BEGIN
  LOCAL UTPLST:={};
  LOCAL OKC,UTP;
  LOCAL TTL:={"//"};
  LOCAL LBL:={"Select"};
  LOCAL HLP:="HH";

  LOCAL ASTEROIDS:={"ONE","TWO","THREE"};


  OKC:=INPUT({{UTPLST,ASTEROIDS}},TTL,LBL,HLP,1,1);
  MSGBOX(UTPLST);
  OKC:=INPUT({{UTPLST(1),1},{UTPLST(2),1}},TTL,LBL,HLP,1,1);
 END;

EXPORT UN()
BEGIN
 BS()
END;
(If that code had worked, I would have gone on to replace 1,2 with I=1 to size(ASTEROIDS)...)

Is there a way to do this with a list?

The output could either be a list of the same size as ASTEROIDS, populated with true and false...
Or a smaller list containing just those which have been selected/unselected.

If this cannot be done, could the functionality be added, either to INPUT or CHOOSE?

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Is there a way to input a multi-selection-checkbox of arbitrary length? (SOLVED) - StephenG1CMZ - 11-09-2015 06:08 PM



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