Duplicate variable GLCD_WXPOS when compiling GLCD_Meter_Needle

Started by broderic, Mar 29, 2025, 06:08 AM

Previous topic - Next topic

broderic

Hello.
When compiling the GLCD_Meter_Needle.bas I downloaded from the forum, I have enclosed error.
Thank you very much for any suggestion to fix it.
Regards



RGV250

Hi,
Are you referring to the files here https://protoncompiler.com/index.php/topic,2120.msg16277.html#msg16277
I downloaded it and had errors due to Small_Font_7.inc not found. I used a different font and it compiles but doubt it will work due to the font I used.

One thing confuses me, it uses Pprint and I thought somewhere on the forum that did not work anymore with the new compiler?

Regards,
Bob

top204

I've just compiled the needle program and it compiled fine with the latest Positron8 compiler.

I have attached the code listing I compiled, and it is named: "GLCD_Meter_Needle_Experiment.zip"

The folder also has the Proteus simuation project, and a compiled Hex file:

broderic

Thank you Bob for yor attention.

Many many thanks Les for your kind support and answer.

So I guess my problem is that I still have Positron version 4.0.0.7 I bought in 2021.
I found in assembly code that for the same GLCD_wXpos variable two different address locations are assigned; maybe this is the issue.
For the moment being I worked around the problem by replacing

'Global Dim GLCD_wXpos As Word Shared
'Global Dim GLCD_wYpos As Word Shared

with
 Dim GLCD_wXpos As Word
 Dim GLCD_wYpos As Word

in the head of code, and everything seems OK.
Don't know if it is completely correct.

I will update my compiler. Hope I have no problem, because due to my old PC crash I moved the compiler on a new PC. Let's see.

Thanks again Les for your work and for this nice compiler.

Regards


top204

Many thanks for your kind words broderic.

The Shared directive had not been implemented fully in the earlier versions of the Compilers. So all code I upload to the forum will be created with the newest compiler versions, with any additions made to them that make the code more efficient.

Regards
Les