Post Reply 
Multiple Choice for CHOOSE command
08-22-2018, 08:56 PM
Post: #13
RE: Multiple Choice for CHOOSE command
(08-22-2018 10:16 AM)Giancarlo Wrote:  Hello Han,
Thanks for the hint. While I am able to build INPUT check boxes, the difficult part here is the dinamic creation of variables to feed the INPUT command.

I still didn’t check how you did it for your Equation solver but I will do it as soon as possible. If we consider a list of options like:
LST:={“arancio”, “limone”,”mandarino”,...};

You can’t use this list as variables because they are strings and, if you remove the “” then it create another errore maybe because the system doesn’t recognize these words since they are not declared.

So, what could be the approach here to bypass this issue?

On more, while for an input box it makes sense that the ‘tick’ box is drawn on the right side of the label, for a check list it would be better to have the ‘tick’ box on the left side of the label. This is just an aesthetic comment, not very important at this stage.

Thanks

Giancarlo from the cappuccino state

The "simple" answer on building dynamic (i.e. using input parameters that are not statically defined) is to use strings and use the expr() command. The following is not intended as working code, but to give you an idea of how to build the string to evaluate.

Code:

LOCAL vars1, vars2, vars3; // use however many you need
LOCAL cmd:="input(";
LOCAL result;

// create the input command using strings
cmd:=cmd + string(vars1) + "," + string(vars2), <and so on...> ;

result:=expr(cmd);

If you look at the equation library, it generates the input forms for each set of equations without knowing a priori which set of equations/variables are selected.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Multiple Choice for CHOOSE command - Han - 08-22-2018 08:56 PM



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