# HP Forums

Full Version: Maximum number of LOCAL variables?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am getting syntax errors in a program that has more LOCAL variables than I have used before, and the error cursor always goes to a variable in my LOCAL variable list. named maxheight I can find no flaw in the variable (but, who knows?). Several questions come to mind:
Is there a maximum number of permitted local variables? If so, what is it?
Can a LOCAL list be split and continued on a second or third line? If so, how?
What IS the maximum line length permitted in a Prime program?
Does the language permit the inclusion of more than one LOCAL statement?
These seem to be pretty basic questions, but I cannot find information about them in the "User Guide." Is there any more comprehensive source of information??

Many thanks for information on these.

Ben Fairbank
You can use any local statements you want.

Code:
```local aa,ab; local ac; local ad:=1; local ae:=aa,af:=ab;```

Post your code, the error is probably in another line.
maximum is 8 variables in a LOCAL line.
as many LOCAL lines as you need.
Eried --
Thank you for the suggestion.
Here are the lines I think are most likely to be giving the error:

LOCAL pp, qq, xcor, pi, denom, height, num, xmode, maxheight,propheight,
finalheight; [this is all on one line]

many lines omitted

// Plot the distribution:
FOR X FROM 15 TO 303 STEP 1 DO
xcor := (X-15)/288;
num := (xcor^(pp-1))*((1-xcor)^(qq-1));
propheight := num/(denom*maxheight);
finalheight := 160 - propheight*156;
PIXON(X,finalheight);
PIXON(X,(finalheight+1));
END;

The above lines simply step through X-axis lines from 0 to 1 and plot the distribution of the y variable associated with X.

If I comment these lines out, AND remove their variables from the LOCAL list, the syntax error stops appearing.
Ben
As patrice said, you have to split that local in 2 (8 vars max per local)
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :