Error in IMAGE

Moderator: Rathinagiri

Post Reply
User avatar
pctoledo
Posts: 123
Joined: Wed Aug 25, 2010 10:45 am
Location: Araçatuba - SP - Brazil
Contact:

Error in IMAGE

Post by pctoledo »

Hi Friends, compiling and running the file \samples\image\demo_1.prg displays the following error:
Error BASE/42 Scope violation (protected): IMAGE:OPARENT
This error started after the update the current SVN.
Regards/Saludos,

Toledo

Clipper On Line
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Error in IMAGE

Post by l3whmg »

Hi Pctoledo,
I'm working to have data protected: this is the problem.
Could you please give me more detail about error?

Best regards
Luigi from Italy
www.L3W.it
User avatar
pctoledo
Posts: 123
Joined: Wed Aug 25, 2010 10:45 am
Location: Araçatuba - SP - Brazil
Contact:

Re: Error in IMAGE

Post by pctoledo »

Hi Luigi, more detail about error, please... compiling and running the file \samples\image\demo_1.prg.
Regards/Saludos,

Toledo

Clipper On Line
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Error in IMAGE

Post by l3whmg »

Many thanks! :lol:
Luigi from Italy
www.L3W.it
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Error in IMAGE

Post by l3whmg »

Hi PcToledo,
I'm investingating about this problem: it seem to be related with the name of the class "IMAGE". If I change the name (ie LUIGI) work fine. Very strange and difficult to find. I have asked help and now we are two people.
Please give me time.
Cheers
Luigi from Italy
www.L3W.it
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Error in IMAGE

Post by l3whmg »

Hi friends.
Today I find the problem but not the solution.
The problem seems to be Harbour when is defined a class with the same name of a method within other class.
I have reduced the HMG4 core code to the minimal required and I removed method image from control.prg and voilà: image class work properly.
MrDuck (many thanks for help and support) is writing to Harbour mailing list...to know how to.
ASAP I will inform community.
Cheers
Luigi from Italy
www.L3W.it
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Error in IMAGE

Post by l3whmg »

Hi friends.

For everyone who want see the problem, here you can find a simple console mode program.

Cheers
Attachments
ClassTest.zip
console test
(1.25 KiB) Downloaded 215 times
Luigi from Italy
www.L3W.it
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Error in IMAGE

Post by l3whmg »

Hi friends. We have a news and no very good. Anyway this is the answer.
.......
In general using class names as method names creates problem
with supercasting.
By default each ancestor is added as a method which can be used
for supercasting. It is also used to resolve name conflicts in
method names and check scopes. When you overwrite IMAGE method
then class code does not find IMAGE as class ancestor of current
object so it does not allow to execute any protected method of
this object.
Przemysław Czerpak
In this situation, IMHO we must change the "METHOD Image( aValue )" within CLASS control and everywhere, but....
Perhaps, we can naming "Images" but it's very, very similar.
Someone can search all "Image" methods and why they are used?
This will be another incompatibility

Cheers
Luigi from Italy
www.L3W.it
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Error in IMAGE

Post by l3whmg »

Hi friends.
To have a good solution in this moment, I change from IMAGE class to BITMAP class.
Please update from svn and read comment here viewtopic.php?f=32&t=1777&start=40

Cheers
Luigi from Italy
www.L3W.it
Post Reply