HP Prime Programming: LOCAL



Is there a limit to how many arguments a LOCAL command admits?
A program that I am writing has the line

LOCAL A, B, C, I, J, K, X , Y, Z;

and results in a "bad syntax" message, with the cursor right before the Z. With that line replaced by two LOCAL, as

LOCAL A, B, C, I, J, K, X, Y;


my program runs fine. So it seems that 8 is the maximum number of arguments for LOCAL. However page 533 of the User Guide seems to indicate that LOCAL admits any number of arguments.

Thank you.

Edited: 6 Oct 2013, 8:46 p.m.


Yes, a single call is limited to 8 on one line. Any guess as to the number of bits we had available to use in the "local" command structure?


Edited: 6 Oct 2013, 9:31 p.m.


It's probably best that way -- too many and source code becomes less legible. And it only gets worse if local variables are also initialized in the same line they are declared.



Function calls (and LOCAL is a function call) are limited to 16 arguements for 'technical reasons'...

LOCAL (and other variables defintions) are in fact of rht form:
LOCAL(var_name1, var_init_value_1, ... ,va-name_n, var_init_value_n);

if you do not specify init values for your variables, 0 is used...

this is the reason for the 8 local limitations.

the syntax to specify init value is:
LOCAL A=1+2, B=2+3; (or alternatively :=)


Possibly Related Threads...
Thread Author Replies Views Last Post
  Programming workaround for "prepend" HP PRIME Marek Russ 4 659 11-29-2013, 05:46 AM
Last Post: Marek Russ
  HP Prime - local variables retain their initial type BruceH 4 661 11-10-2013, 12:42 PM
Last Post: Michael de Estrada
  hp prime - programming with lists giancarlo 3 625 11-10-2013, 02:13 AM
Last Post: Giancarlo
  HP Prime Programming Tutorial #3: WHILE, INPUT, KILL, REPEAT, GETKEY Eddie W. Shore 5 833 11-07-2013, 12:25 AM
Last Post: Han
  HP Prime - programming bluesun08 2 516 11-04-2013, 04:31 PM
Last Post: bluesun08
  More undocumented programming limitations in the HP Prime Michael de Estrada 3 670 11-03-2013, 08:22 PM
Last Post: Michael de Estrada
  HP Prime questions: I/O and Meta programming Andy Gryc 2 537 10-31-2013, 11:22 PM
Last Post: Andy Gryc
  HP Prime Programming Tutorial #1: LOCAL, RETURN Eddie W. Shore 6 987 10-26-2013, 08:42 PM
Last Post: Miguel Toro
  HP Prime Programming Tutorial #2: MSGBOX, IF-THEN-ELSE, PRINT, FOR Eddie W. Shore 0 439 10-26-2013, 03:51 PM
Last Post: Eddie W. Shore
  HP Prime : Programming and the Comma Miguel Toro 7 943 10-25-2013, 12:18 PM
Last Post: Miguel Toro

Forum Jump: