On Thu, 01 May 2008 15:23:29 +0200
Marc Weustink <[EMAIL PROTECTED]> wrote:
> Mattias Gaertner wrote:
>[...]
> > ReAllocMem(p,0);
>
> Ah, now I understand why you use them :)
>
> Anyway does it set p:=nil ?
Yes.
Mattias
___
fpc-pascal maillist - fp
Mattias Gaertner wrote:
On Wed, 30 Apr 2008 01:22:47 +0200
Marc Weustink <[EMAIL PROTECTED]> wrote:
Alan Krause wrote:
Hans MÃ¥rtensson wrote:
But that would not work after the pointer was used and then it's
memory freed.
So a better way might be:
Always when declaring pointers do it this w
On Wed, 30 Apr 2008 01:22:47 +0200
Marc Weustink <[EMAIL PROTECTED]> wrote:
> Alan Krause wrote:
> > Hans MÃ¥rtensson wrote:
> >> But that would not work after the pointer was used and then it's
> >> memory freed.
> >> So a better way might be:
> >>
> >> Always when declaring pointers do it this
Alan Krause wrote:
Hans MÃ¥rtensson wrote:
But that would not work after the pointer was used and then it's
memory freed.
So a better way might be:
Always when declaring pointers do it this way:
var p: ^sometype = nil;
Then in stead of using the freemem, define your own procedure:
procedur
Hans MÃ¥rtensson wrote:
But that would not work after the pointer was used and then it's
memory freed.
So a better way might be:
Always when declaring pointers do it this way:
var p: ^sometype = nil;
Then in stead of using the freemem, define your own procedure:
procedure myfreemem(var p: p
Joao Morais wrote:
Jonas Maebe wrote:
On 29 Apr 2008, at 15:35, Zaka E-Lab wrote:
It's possible to give a default initialization value to a defined type?
No, that is not possible.
Except if your pointer is declared as a member of a class (which is
always assigned to nil by default)
Jonas Maebe wrote:
On 29 Apr 2008, at 15:35, Zaka E-Lab wrote:
It's possible to give a default initialization value to a defined type?
No, that is not possible.
Except if your pointer is declared as a member of a class (which is
always assigned to nil by default)
___
On 29 Apr 2008, at 15:35, Zaka E-Lab wrote:
It's possible to give a default initialization value to a defined
type?
No, that is not possible.
Jonas
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/li
It's possible to give a default initialization value to a defined type?
I suppose that it isn't, but it would be to easy to resolve that trouble
that way.
Anyway, I appreciate your help and support.
Thanks.
Zaka.
Jonas Maebe escribió:
It cannot know that without help. You have to do such book
On 29 Apr 2008, at 14:48, Zaka E-Lab wrote:
I don't create anything, the memory is allocated by the create
procedure. How can the procedure know if the argument is a pointer
already allocated or not?
It cannot know that without help. You have to do such bookkeeping
yourself (e.g., as mentio
Maybe I haven't explain it correctly. What I want is to construct a
Unit that contains some procedures, one of them is
create(var p : PStruct), and other is delete(var p : PStruct).
I don't create anything, the memory is allocated by the create
procedure. How can the procedure know if the argumen
You can assign "nil" to the pointer before using it, then check if PStruct =
nil it wasn't
created.
Leonardo.
--- Zaka E-Lab <[EMAIL PROTECTED]> wrote:
> I have something like this:
>
> PStruct = ^Struct;
> Struct = record
> num: integer;
> end;
>
> I have a unit to ha
I have something like this:
PStruct = ^Struct;
Struct = record
num: integer;
end;
I have a unit to handle that structure ( is a bit more complicated, but
is a good example), in this unit I have a procedure that deletes (
disposes ) the pointer. How can I know if a pointer a
13 matches
Mail list logo