Post Reply 
Maximum number of LOCAL variables?
03-09-2014, 06:48 AM
Post: #1
Maximum number of LOCAL variables?
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
Find all posts by this user
Quote this message in a reply
03-09-2014, 06:59 AM (This post was last modified: 03-09-2014 07:00 AM by eried.)
Post: #2
RE: Maximum number of LOCAL variables?
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.

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
03-09-2014, 07:20 AM
Post: #3
RE: Maximum number of LOCAL variables?
maximum is 8 variables in a LOCAL line.
as many LOCAL lines as you need.

Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
Find all posts by this user
Quote this message in a reply
03-09-2014, 08:15 AM
Post: #4
RE: Maximum number of LOCAL variables?
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
Find all posts by this user
Quote this message in a reply
03-09-2014, 11:47 AM
Post: #5
RE: Maximum number of LOCAL variables?
As patrice said, you have to split that local in 2 (8 vars max per local)

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)