Post Reply 
INPUT Command Syntax (SOLVED).
03-23-2015, 05:13 PM (This post was last modified: 03-24-2015 07:07 PM by Spybot.)
Post: #1
INPUT Command Syntax (SOLVED).

Hi Everyone!!

I guess I need a little bit of help on the syntax of the INPUT command. I'm trying to create some sort of drop-down menu, so I can choose an option.
I read the UG. and the built-in help on the calculator, I entered the corresponding code for that, and I'm still getting an error message. ("see screenshot # 1
")

I'm trying to create something like the screenshot # 2 & 3.

here is my code:

EXPORT program()
BEGIN
INPUT({D,{"OPTION 1","OPTION 2","OPTION 3","OPTION 4"},{20,70,3}},{"Main title"},{"LABEL"},{"HELP 1","HELP 2","HELP 3","HELP 4"},0,0);
END;

Thanks, any help will be appreciated.

           

Spybot.
Find all posts by this user
Quote this message in a reply
03-23-2015, 06:44 PM
Post: #2
RE: INPUT Command Syntax
Two things. You are attempting to create a field for variable D, and then a non-existent type. Look at your variable list: {D,{"Strings"...

Also, you are defining help strings for 4 fields.

Code:
EXPORT program()
BEGIN
INPUT({{D,{"OPTION 1","OPTION 2","OPTION 3","OPTION 4"},{20,70,3}}},"Main title","LABEL","HELP 1",0,0);
END;

Adding { } around the title field and similar is for additional pages of your input form. If you have one, no need to have it.

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
03-23-2015, 07:24 PM
Post: #3
RE: INPUT Command Syntax
Thank You Tim.

I notice something in the piece of code you wrote:

{{D,{"OPTION 1","OPTION 2","OPTION 3","OPTION 4"},{20,70,3}}} ...

In this line, it seems to me that there is an extra pair of brackets {}, so I took them out and ran the program, I realized that it didn't run!, so I put them back in place and it worked again. my question is why an extra pair of brackets make the difference?

Spybot.
Find all posts by this user
Quote this message in a reply
03-23-2015, 08:06 PM
Post: #4
RE: INPUT Command Syntax
To define a choose in an an input form, you create a list of the form {var,{"choices"...}}.

{ A,B,{C,{"choices"...}} } is 3 objects, A, B and a choose object. Doing {D,{"choices"...} has made one real input D, and then an invalid input item - hence the error.

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
03-23-2015, 09:16 PM
Post: #5
RE: INPUT Command Syntax
That make sense Tim, Thank you for your answer.

Spybot.
Find all posts by this user
Quote this message in a reply
Post Reply 




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