Hello,
before you read my problem I must admid that a. this is my first post
on the forum, b. I've only been working with Clarion for about 3
months now and c. the company I'm working in (using Clarion), doesn't
do any Object Orientated Programming at all...
I thought it was time to change that, so I went over to create a
little class in Clarion 6.1ee.
At first it seem to work fine, helas, taking it to more tests makes it
fail... And I'm looking for some help on why it fails.
About the class: the class is called the savePointerClass. It has no
explicit constructor and no explicit destructor. It has no public
fields either. Only two methods: savePointerClass.SetPtr and
savePointerClass.GetPtr. Both as their only argument take a file. In
the set method, the savepointerclass gets the name of the file, saves
the current pointer on the file and saves what's in the current record
buffer at the time. The get method, checks to see if the same file
was given as an argument, and if so, restores the pointer and what was
in the records buffer.
Where it fails... For example: I got one tps file called buildings.
In an (imaginary) application, I got a table listing all the
buildings. Some off these buildings are let's say appartments.
Appartments belong to a building. So each building line in my table
is clickable, when you click it, an objBuilding (savePointerClass)
saves the info, and displays a the same form with the request to pick
a building from. However, clicking a line in the new table will again
have an objBuilding save the info and showing a third form. Closing
this form, back onto the second form. Closing second form, back onto
the first form. But now, the info that was in my original objBuilding
is lost, it was overwritten when I openened the form a third time!
Basically, opening the form in a new threat is not causing this
problem. Does that mean to say that forms opened in a same threat
with fields (data) with the same name automatically share memory
adresses? I don't understand why, the class isn't declared static at
all.
Any help, or hints and tips would be really appreciated!


|