PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Possible Errors - 0.6c

Item #1:
--------

The line number when reporting errors is sometimes incorrect (for simple errors). I have noted that when wrong it is usually reported to be short of the actual error line by the number of "#inclue, #define and #declare" statements in the file.

Is it possible that these "#" lines are not be included in the file line count?

Item #2:
--------

The following line of code generates a syntax error at cmpile time:

a$ = - (b$ * c$ * d$);

The work around is simple

a$ = -1.0 * (b$ * c$ * d$);

but I would expect the compiler to correctly parse the original line.

Item #3:
--------

Please clarify the meaning of the "local" statement.

I have been using "local (a$,b$,c$);" in all my library procs and funcs to ensure that working variables withing the procedures/functions are truly "local". This is the only way I can see in PPL to ensure that the only interaction between procs/funcs and the remainder of the code is strictly via formal parameters and function return values.

I have noted one scenario here today where a variable (lon$) declared global in my main form, and also used as a working variable in a library proc (and declared "local" within that proc) produced some most unexpected results. The end effect appears that the "local" definition within the proc was ignored. The instance of the variable within the proc overwrites the external "global" variable.

Is this a "bug" or am I mis-interpretting the use of "local"? if I am, then what is the correct way to ensure that variables within "library" procs/funcs do not interact with program variables. In small, simple programs manual intervention can ensure that variable names are not re-used, but as support libraries increase and programs increase in size and complexity this becomes almost impossible.
Hi,

1. Is this when compiling or runtime errors? Can you send me an example at: adeschenes @ megadata.com

2. I will fix the parser.

3. You don't have to declare your variables as locals inside a procedure. PPL should know if the variable doesn't exists already in the global variables list that it is a brand new local variable. There was a bug with 0.6 and earlier that it was converting global variables to local ones when used with the local function. This has been fixed in 0.7.

Regards,
Kornalius
Thanks for all that Kornalius.

I'll attempt to introduce a simple error into one of my programs here and see if I can reproduce the condition I referred to in item #1. I will email something off to you before the end of the day.


cheers
mervjoyce · 20 Jul 2004, 06:30 UTC — Email Sent
Kornalius,

email sent at 0430UTC 20/07

regards
Hi,

1. Fixed the parser, was a problem with {} loop. The line counter wasn't updated inside this loop.

2. The parser has been fixed.

3. The local() function is now fully working. It creates a new local variable instead of moving the global variable locally.

Regards,
Kornalius
mervjoyce · 20 Jul 2004, 22:40 UTC — Thanks
Kornalius,

On behalf of the PPL community I must say many thanks for your efforts.