Re: Global class problem
From: Maarten Wiltink (maarten_at_kittensandcats.net)
Date: Thu, 11 Nov 2004 22:26:03 +0100
"Peter Piper" <NoEmail@Email.com> wrote in message
> Maarten Wiltink wrote:
>> "Peter Piper" <NoEmail@Email.com> wrote in message
>>> What am i doing wrong, do i need to initialize the variable first?
>> You do. Who else are you expecting to do it, and why?
> OK how do I initialize the variable, do you mean call Create as Dug
> pointed out?
> And if so where do i call this from, i remember reading that a unit can
> have an initialization section.??
Ekkehard already gave the answer you need to get it working. I'm only
trying to create understanding (it's a thankless job, making people
think for themselves).
The point is that the call to Create is what causes memory to be
allocated and "filled in" as an object, any object. No call to a
constructor, no object. It doesn't happen by itself. (In other
languages it does. This creates its own problems.)