Error in IMAGE

Moderator: Rathinagiri

Post Reply
User avatar
pctoledo
Posts: 119
Joined: Wed Aug 25, 2010 10:45 am
Location: Araçatuba - SP - Brazil
Has thanked: 3 times
Been thanked: 5 times
Contact:

Error in IMAGE

Post by pctoledo » Wed Aug 31, 2011 8:04 pm

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:

Post by l3whmg » Wed Aug 31, 2011 8:16 pm

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: 119
Joined: Wed Aug 25, 2010 10:45 am
Location: Araçatuba - SP - Brazil
Has thanked: 3 times
Been thanked: 5 times
Contact:

Post by pctoledo » Wed Aug 31, 2011 8:34 pm

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:

Post by l3whmg » Wed Aug 31, 2011 9:50 pm

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:

Post by l3whmg » Wed Aug 31, 2011 11:17 pm

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:

Post by l3whmg » Thu Sep 01, 2011 9:19 am

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:

Post by l3whmg » Thu Sep 01, 2011 12:41 pm

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 43 times
Luigi from Italy
www.L3W.it

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

Post by l3whmg » Tue Sep 06, 2011 6:52 pm

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:

Post by l3whmg » Sun Sep 11, 2011 4:29 pm

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