Post new question
Posts: 19
Member Since: ‎10-11-2013
Message 1 of 4 (835 Views)

HP Prime: Number of external Variables



I need your help. How to make the program very simple below work:


EXPORT TVariables (A, B, C, D, E, F, G, H, I, J, K, L, M, N)


RETURN A + B + C + D + E + F + G + H + I + J + K + L + M + N;


In the edition of the program does not give error, the message is: !No erros in the program. When I go to run it, it pops up the error message: XTVariables: Invalid imput . If I remove 4 variables, the program works. Have as you send me the correct syntax for this program works and I take for base for others?



Grad Student
Posts: 414
Member Since: ‎11-16-2011
Message 2 of 4 (807 Views)

Re: HP Prime: Number of external Variables

Hi!, Davidro:


Welcome, to Forum!.


You didn't use, reserved variables ... e, i, j, n (they are, for other application) ... p.e.: i, j ... imaginary or, complex.

In your example, you can use CAPITAL LETTERS or, lowercase letters.



Too, you can use numeric indicator's with letter's ... e1, i1, j1, n1  ...



Note: See, in the User's Guide Manual, attached, in file.

Master's Graduate
Posts: 355
Member Since: ‎02-04-2014
Message 3 of 4 (772 Views)

Re: HP Prime: Number of external Variables

Hi, David!


The problem is not with your program, but with how you are running it.


The "Run" button in the Program Catalog handles a maximum of 10 parameters. If the program has more than 10 parameters, "Run" only inputs the first 10, attempts to run the program with just those 10, and of course Prime generates an error since there are too few parameters.


The trick is to run your program from Home (or CAS).  This allows you to have any number of parameters.  In your example, you can type this in Home (or CAS):




... and it will return the correct result (105).  Even though built-in functions are limited to a maximum of 16 arguments, programs don't seem to have that limitation.  I just extended your program to the first 17 letters of the alphabet (up to Q), and ran it with parameters 1 through 17, and it returned the correct sum, 153.


Hope that helps!

Posts: 19
Member Since: ‎10-11-2013
Message 4 of 4 (766 Views)

Re: HP Prime: Number of external Variables

Dear Michael:


Thank you for your prompt response, as in other groups have not yet been answered. The big problem is that the system does not export above 10 variables, as in the simple example given: are 14 variables, ranging  from A to N. withdraw  4 any variables the program works. 

My question is: the HP Prime Program Editor  only exports 10 variables? There is another way of working with many external variables in the same program?


Thank you in advance.



† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation