Post Reply 
Is there a way to input a multi-selection-checkbox of arbitrary length? (SOLVED)
11-11-2015, 09:09 AM (This post was last modified: 11-11-2015 09:10 AM by StephenG1CMZ.)
Post: #4
RE: Is there a way to input a multi-selection-checkbox of arbitrary length?
(11-11-2015 06:42 AM)cyrille de brébisson Wrote:  Hello,

So, what you are really looking for is a way to programaticaly create your variable list, both for storing the values AND for the INPUT command...

Why not try:

EXPORT BS()
BEGIN
LOCAL COMETS:={"ALL","Halley","Lewkowicz","The rest"};
LOCAL LST:=MAKELIST(0,I,1,SIZE(COMETS));
LOCAL OKC,UTP;
LOCAL TTL:={"//"};
LOCAL HLP:="HH";
local l2= MAKELIST({'LST(I)',1},I,1,SIZE(COMETS));
OKC:=EVAL(EXPR("INPUT("+STRING(l2)+",TTL(1),COMETS,HLP,1,1)"));
END;

The INPUT command needs both the NAME of the variable and their values...
This is why INPUT does NOT evaluate its first parameter, if it did evaluate it, then it would NOT be able to get the variable name that it needs...
As a result, it is NOT possible to use a programmatic way/method to generate that first parameter, because recalling it, is an evaluation, which does not happen...
Hence the use of a string there to generate the TEXT of the INPUT statement and then the conversion from text to an expression, which is then evaluated...

Cyrille
That looks right, but there is something wrong with the MAKELIST...
It generates LST1...LST1... for some reason.
If that is manually changed to LST1...LST2... Then LST has the desired output.
Code:
EXPORT BS()
BEGIN
LOCAL COMETS:={"ALL","Halley","Lewkowicz","The rest"};
LOCAL LST:=MAKELIST(0,I,1,SIZE(COMETS));
LOCAL OKC,UTP;
LOCAL TTL:={"//"};
LOCAL HLP:="HH";
local l2= MAKELIST({'LST(I)',1},I,1,SIZE(COMETS));
 local l2={{'LST(1)',1},{'LST(2)',1},{'LST(3)',1},{'LST(4)',1}};
OKC:=EVAL(EXPR("INPUT("+STRING(l2)+",TTL(1),COMETS,HLP,1,1)"));
 MSGBOX(LST);
END;

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
RE: Is there a way to input a multi-selection-checkbox of arbitrary length? - StephenG1CMZ - 11-11-2015 09:09 AM



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