The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

Input syntax on the Prime
Message #1 Posted by Gilles Carpentier on 22 Aug 2013, 2:00 p.m.

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

      
Re: Input syntax on the Prime
Message #2 Posted by Mic on 22 Aug 2013, 2:31 p.m.,
in response to message #1 by Gilles Carpentier

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

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

      
Re: Input syntax on the Prime
Message #3 Posted by Mic on 22 Aug 2013, 2:41 p.m.,
in response to message #1 by Gilles Carpentier

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

            
Re: Input syntax on the Prime
Message #4 Posted by Gilles Carpentier on 22 Aug 2013, 3:28 p.m.,
in response to message #3 by Mic

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.

                  
Re: Input syntax on the Prime
Message #5 Posted by Mic on 22 Aug 2013, 3:40 p.m.,
in response to message #4 by Gilles Carpentier

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

      
Re: Input syntax on the Prime
Message #6 Posted by cyrille de brebisson on 23 Aug 2013, 2:49 a.m.,
in response to message #1 by Gilles Carpentier

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

            
Re: Input syntax on the Prime
Message #7 Posted by Gilles Carpentier on 23 Aug 2013, 4:31 a.m.,
in response to message #6 by cyrille de brebisson

Thank's

Merci pour ces précisons !


[ Return to Index | Top of Index ]

Go back to the main exhibit hall