Improvement for the INPUT command
02-24-2017, 06:31 PM (This post was last modified: 02-27-2017 12:34 AM by compsystems.)
Post: #1
 compsystems Senior Member Posts: 1,193 Joined: Dec 2013
Improvement for the INPUT command
Hello, if the INPUT command only contains a variable, when entering the data must be kept on the screen, a second [enter] executes and exits the dialog box, otherwise I can not edit it, If I enter it wrongly

Test example

PHP Code:
export x:=0;export y:=0;export z:=0;export input1var()BEGIN  //x:=5;  print();  print("input cmd with a variable"); wait;  input( x );  print("foo1"); wait;  foo1();  input( y );  print("foo2"); wait;  foo2();  input( z );  print("foo3"); wait;  foo3();  return "Done";END;
02-24-2017, 08:22 PM (This post was last modified: 02-24-2017 08:33 PM by EdDereDdE.)
Post: #2
 EdDereDdE Junior Member Posts: 27 Joined: Jan 2017
RE: Improvement for the INPUT command
AH, I needed to test what you mean.
Hm, maybe encapsulate the input into a loop which redisplays the input if the value has changed.
At least until there is a change in the firmware?
02-27-2017, 12:34 AM
Post: #3
 compsystems Senior Member Posts: 1,193 Joined: Dec 2013
RE: Improvement for the INPUT command
loop is an option but not elegant, another told me to use a single INPUT with three input variables ({x, y, x}, ...
but the logic of the algorithm is that you first get a varible and then execute any one function or prg foo1 () and so on.
02-27-2017, 03:21 AM
Post: #4
 Han Senior Member Posts: 1,810 Joined: Dec 2013
RE: Improvement for the INPUT command
I think it makes sense to keep the behavior as it currently is. When INPUT() has several input fields, then it makes sense to require the user to press "OK" (in the menu) or the [Enter] key because the it is quite possible that while entering the next input field, the user may realize that the first input needs modification. Simultaneously entering many input values is more prone to error than entering in a single input field.

When there is only a single input field, then any realization of a mistake would and should happen during the edit phase. There is no reason to press the [Enter] key until the input is indeed verified as the desired input (there is nothing else to check). Requiring an extra [Enter] or "OK" just adds an unnecessary step.

Graph 3D | QPI | SolveSys
02-27-2017, 04:47 AM
Post: #5
 compsystems Senior Member Posts: 1,193 Joined: Dec 2013
RE: Improvement for the INPUT command
For the case of a single data, if the entered data is correct, if there is an extra step, but if the entered data is incorrect, how do you re-edit it?

In user-RPL works for a single field, same as my suggestion

PHP Code:
"title"{{ "x" "help" 0 }}1{ 98 }{ 99 }INFORMIFTHEN { 'x' } STOEND"title"{{ "y" "help" 0 }{ "z" "help" 0 }}1{ 87 76 }{ 88 77 }INFORMIFTHEN { 'y' 'z' } STOEND
02-27-2017, 06:33 AM
Post: #6
 Han Senior Member Posts: 1,810 Joined: Dec 2013
RE: Improvement for the INPUT command
(02-27-2017 04:47 AM)compsystems Wrote:  For the case of a single data, if the entered data is correct, if there is an extra step, but if the entered data is incorrect, how do you re-edit it?

In user-RPL works for a single field, same as my suggestion

PHP Code:
"title"{{ "x" "help" 0 }}1{ 98 }{ 99 }INFORMIFTHEN { 'x' } STOEND"title"{{ "y" "help" 0 }{ "z" "help" 0 }}1{ 87 76 }{ 88 77 }INFORMIFTHEN { 'y' 'z' } STOEND

Why would you expect to be able to re-edit the input? You had the chance to check your input while filling out the input field. Your program should behave just like any other command that has been given the wrong input -- return an error message. If you want continually allow the user many attempts to enter a valid input, then you would need a loop that also checks to see if the input is valid -- and this would be the case whether your input command uses a single variable or many variables.

Graph 3D | QPI | SolveSys
02-27-2017, 10:13 AM
Post: #7
 EdDereDdE Junior Member Posts: 27 Joined: Jan 2017
RE: Improvement for the INPUT command
(02-27-2017 06:33 AM)Han Wrote:  If you want continually allow the user many attempts to enter a valid input, then you would need a loop that also checks to see if the input is valid -- and this would be the case whether your input command uses a single variable or many variables.

That is what I meant, and what is common in IT: encapsulate user entries into plausibility / range / etc. checks.
 « Next Oldest | Next Newest »

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