11-02-2013 06:08 AM
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?
11-02-2013 07:43 AM
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.
11-02-2013 11:19 AM
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!
11-02-2013 11:31 AM
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.