Post Reply 
Basic INPUT help
04-01-2017, 01:00 AM
Post: #1
Basic INPUT help
I am trying to create a basic input. Here is what I got:

EXPORT TEST()
BEGIN
LOCAL A;
INPUT({{A,[1]}},"TEST"," INTEGER INPUT:")
END;

I want to limit the inputs to integers only, and not floats, however when I try to enter anything into the box, I get "Invalid Input".

What am I not understanding here?
Find all posts by this user
Quote this message in a reply
04-01-2017, 09:33 AM
Post: #2
RE: Basic INPUT help
Hello,
With os version 10637 it didn't work for me as well. .
It worked with type 2 (strings) and type 0 (reals) not with type 1 (integers).

Thanks
Find all posts by this user
Quote this message in a reply
04-01-2017, 10:17 AM
Post: #3
RE: Basic INPUT help
It works but you have to enter the integer with a # prefix and an optional base suffix (d,b,o,h).
Find all posts by this user
Quote this message in a reply
04-01-2017, 04:13 PM
Post: #4
RE: Basic INPUT help
Ok. Well that seems counter intuitive. I wanted to use the input form as a easy way to input values and work on them, using the filter type of integer seems like a waste if you have to enter a #d for each enter instead of just entering a integer.

I thought it would be an easy way to protect against non integer values. Leaving it open to all types will be fine for now until I get more familiar with this programing language.
Find all posts by this user
Quote this message in a reply
04-01-2017, 04:31 PM (This post was last modified: 04-01-2017 04:32 PM by AngryNapkin.)
Post: #5
RE: Basic INPUT help
Well let me ask some advice, because this relates to my other question I posted with the solve() not working right.

Basically I am trying to make a simple INPUT dialog that updates every time the user enters some values. I have the INPUT running in a while loop.
When the number are input, the variables get worked on, and re updated, and the loop restarts, populating the INPUT with the new values.
I wanted to use the simple solve() command to solve for one of three values.
For example

While INPUT({A,B,C},"Test Input) > 0 DO
// Some testing here to find which solve() line to run
solve(A+B=C,A)sto>A
solve(A+B=C,A)sto>B
solve(A+B=C,A)sto>C
END;

So basically, i check to see witch value needs updating, and based on the other two, the solve() finds the answer. This is a crude example, but about as simple as I need.

I know there is the Solver which does work, but I was trying to get this to work in a program without the need to have to enter a formula first and then run the Solver.


Is there an easier way to go about this?
Find all posts by this user
Quote this message in a reply
04-06-2017, 05:28 PM
Post: #6
RE: Basic INPUT help
(04-01-2017 04:13 PM)AngryNapkin Wrote:  Ok. Well that seems counter intuitive. I wanted to use the input form as a easy way to input values and work on them, using the filter type of integer seems like a waste if you have to enter a #d for each enter instead of just entering a integer.

"integers" in home refer to a fixed size, specific base encoded value more akin to a lower lever computer register value. For example, you can have a 16 bit, signed, octal number and similar things.

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
Post Reply 




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