Page 1 of 1

Error in IMAGE

Posted: Wed Aug 31, 2011 8:04 pm
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.

Re: Error in IMAGE

Posted: Wed Aug 31, 2011 8:16 pm
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

Re: Error in IMAGE

Posted: Wed Aug 31, 2011 8:34 pm
by pctoledo
Hi Luigi, more detail about error, please... compiling and running the file \samples\image\demo_1.prg.

Re: Error in IMAGE

Posted: Wed Aug 31, 2011 9:50 pm
by l3whmg
Many thanks! :lol:

Re: Error in IMAGE

Posted: Wed Aug 31, 2011 11:17 pm
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

Re: Error in IMAGE

Posted: Thu Sep 01, 2011 9:19 am
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

Re: Error in IMAGE

Posted: Thu Sep 01, 2011 12:41 pm
by l3whmg
Hi friends.

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

Cheers

Re: Error in IMAGE

Posted: Tue Sep 06, 2011 6:52 pm
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

Re: Error in IMAGE

Posted: Sun Sep 11, 2011 4:29 pm
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