Re: having difficulty getting the unit to use an include file



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

.



Relevant Pages

  • Re: Cant understand this! (Help required please)
    ... > If delete in pop deletes the nde, the new string that was pointed to by ... > node previously would still exist without a pointer had a string not ... you are allocating memory to hold the `data' that you are maintaining ... you are allocating memory to hold the structure for a node itself. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Collection interface..
    ... String, then find the information and use substringto extract it ... The original String actually shares data with its ... of garbage in memory. ... The String constructor that takes ...
    (comp.lang.java.help)
  • Re: Fast string operations
    ... Looping: I thought looping over arrays in managed code was "slow" ... array handling and such. ... The problem with TrimHelper is that it always returns a new string instance. ... The customer perceives this as a memory leak. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Discovering variable types...
    ... >- but I suppose MS expect us to use wrappers ... memory allocations for your variables from disk as well. ... >They most certainly are of fixed size, changing the size of a String ... >>me to keep buffer size and current postion right in the memory block. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Readings on clr optimization?
    ... The compiler cannot inline a call to a constructor if the class has a static ... Weak references are special objects that allow you to track references that ... There aren't many implication with memory ...
    (microsoft.public.dotnet.framework.clr)

Quantcast