HP Forums
input from user - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: input from user (/thread-4924.html)

input from user - ji3m - 10-11-2015 07:21 PM

Is there any way to get a single line input from user without filling the entire screen with a form as INPUT does?

The hard question is twofold. What i need is

(1) user input from the normal input line. Even msdos lets me do this.

(2) multi line user input . The INPUT function takes up the entire screen but still is a single line form.

What is needed is just simple access to the input buffer from a program.

avar := userinput ();

which returns a raw string when the user hits return.

So do i need to write my own editor just to get non-form base raw input?

RE: input from user - cyrille de brébisson - 10-12-2015 07:03 AM


> user input from the normal input line. Even msdos lets me do this.

But windows does not :-)

Prime is a GUI system, not a command line based system (although it is closer to it than windows).

User inputs in prime are either through the command line WHEN THE PROGRAM IS CALLED. As arguments to your program (MyProgram(args))
Or you need to spawn a GUI to get an input.

Prime does not have a console like dos does, your program can, for example, be called from the program catalog screen. At that point, there is no command line, no console...

INPUT is a very easy way to get data from the user (even if it's full screen). I mean INPUT(MY_Well_Named_Variable) is very simple and very efficient.
If you want a string, things are a little bit more complex as you need to tell INPUT to restrict the types of input that the user can enter (it tries to do too much for you by default).
INPUT({{My_String_Var, [2]}}) will do that, create a full screen INPUT that will request a string from the user and store it in My_String_Var

I hope that this helps.


RE: input from user - ji3m - 10-12-2015 12:31 PM

I know it is gui based but the appearanve of bot the home and cas views is that of a console with scrolling history. The entry line certaintly looks and acts like a command line. It is access to that buffer that I would like but before the prime intercepts it.

I guess that is too far inside the systrm input.

RE: input from user - cyrille de brébisson - 10-12-2015 03:05 PM


I understand, and yes, you are correct, the home, or CAS does LOOK like a console driven interface... but is not one. It is more of a command line based IO system.

Could we have a different type of INPUT that would display the command line only (what would the rest of the screen look like BTW)?

It might be possible, we would need to look at it, but it is, for sure, not possible at this point in time.


RE: input from user - ji3m - 10-13-2015 03:03 AM

Well, to tell my story i am trying to write an app which for .
no other reason than maybe nostalga will create a user rpl/rpn (48-50) interface and allows programs,variables, etc.

I have most of it working, simulated stack, rpl compiler, etc. In the end i will take over the entire screen and use mouse and keyboard events. The app will then own the keyboard and user interface.

What i was really after with my 'input' question was trying to avoid also having to build a full editor from scratch.

I know i can tranfer text to and from a system Note under program control . But what i cannot do is invoke the note text editor from a program and have it return the edited user input. It would make my day if i could do such a thing in the future.