HP Forums

Full Version: Input syntax on the Prime
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

The input syntax of the prime allows to enter all types of datas (including quoted expression)and multiple items

here is an example :

EXPORT Inp
BEGIN
LOCAL m1,m2,s:="Enter the matrix using the [ ] key";
IF INPUT({m1,m2},"Multiply matrix",{"Enter m1","Enter m2"},{s,s}) THEN
m1*m2
ELSE
"Cancel"
END;
END;

Another example:

INPUT(F1,"Enter a function between ' '")

And you get the function F1 in the Apps 'function'

Rev 5106 needed. The syntax is describe in the integrated help.However i was unable to use the 'default value' parameters... Next rev ?

Only the first parameter is needed (variable or list of variables), all others are optional

Edited: 23 Aug 2013, 4:29 a.m. after one or more responses were posted

Ah stock the function var in F1, OK.
I had the 4980 rev...


Edited: 22 Aug 2013, 2:33 p.m.

I have an invalid error when I execute INPUT(F1);

I was perhaps 'brutal' here.

It seems to need that F1 is defined before because INPUT(VAR) recall the value of the VAR

LOCAL f;
BEGIN
INPUT (f);F1:=f;
...

seems better (not tested) and I've not verify in the APPS Function commands if there is something special (to check etc ...)

By the way, try INPUT M1 for example.

EDIT :just tested and seem OK

If you want "pseudo-typed" variable :

BEGIN
LOCAL a:=[[0,0],[0,0]];
INPUT(a);
END;

or

BEGIN
LOCAL a:="";
INPUT(a,"Enter your name");
END;

Edited: 22 Aug 2013, 3:33 p.m.

Yes, I used an intermediate var and it works : INPUT(f); f>F1;

Hello

Quote:
Rev 5106 needed. The syntax is describe in the integrated help.However i was unable to use the 'default value' parameters... Next rev ?

help is incorrect, it's not the default, but the reset value...
default value (ie, value presented at opening of the input) is the value held in the varaible at the time INPUT is called.

reset value, a parameter specified in the INPUT command is used when you press backspace or CLEAR.

Cyrille

Thank's

Merci pour ces précisons !