Re: having difficulty getting the unit to use an include file
- From: "alanglloyd@xxxxxxx" <alanglloyd@xxxxxxx>
- Date: 29 Aug 2005 22:57:45 -0700
a) By convention type names have a "T" prefix - this is for a reason -
it helps you differentiate between types and instances of that type.
b) Yypes must have an instance of that type to use in your code.
c) Instances of objects are created by calling a type class
"constructor" function which returns the instance. Non-objects are
created by allocating memory for them, either automatically by
declaring a variable of that type, or by allocating memory to a pointer
to the non-object. If memory is allocated by declaring a variable of
that type, the instance is valid only within the "scope" of the
declared variable.
d) Memory you have allocated for instances of types must be freed when
you have finished using it (or just left for the OS to free when you
close the application - but this is not professional).
Look up ...
instance
constructor
scope
memory
.... in Delphi help.
Be aware that a record containing string types will hold only a
reference to the string, not the actual string itself. This means that
records containing strings are more complex to store in files (so that
they are "persistent" from session to session).
Alan Lloyd
.
- References:
- having difficulty getting the unit to use an include file
- From: Adam Sandler
- having difficulty getting the unit to use an include file
- Prev by Date: Cannot Tab to DBRadioGroup
- Next by Date: Re: OOP style
- Previous by thread: Re: having difficulty getting the unit to use an include file
- Next by thread: Cannot Tab to DBRadioGroup
- Index(es):
Relevant Pages
|