🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.language.objectpascal
2 messages
2 total messages Started by Jason Grace Mon, 04 Oct 2004 16:01
Pointer dereference
#26
Author: Jason Grace
Date: Mon, 04 Oct 2004 16:01
16 lines
976 bytes
Say, you declare:

R = Record
  X, Y: integer;
  S: string;
end;

P = ^R;


...


You then dereference the above S by P^.S, correct?

Sometimes I will see just P.S, without the ^.  When is this legal?
Re: Pointer dereference
#27
Author: Skybuck Flying
Date: Wed, 06 Oct 2004 00:46
44 lines
1740 bytes
"Jason Grace" <jgrace5@hotmail.com> wrote in message
news:642169be.0410040801.5e72b647@posting.google.com...
> Say, you declare:
>
> R = Record
>   X, Y: integer;
>   S: string;
> end;
>
> P = ^R;
>

Actually it something like

Type
    Pr
    Tr = record
        x,y : integer;
        s : string;
     end;

var
    p : Pr;

p := @r;

p^

>
>
> You then dereference the above S by P^.S, correct?

Yep.

>
> Sometimes I will see just P.S, without the ^.  When is this legal?

Since a certain delphi version.

P.S doesn't mean anything for a pointer so it might as well be
interpreted/compiled as P^.S ;)

Less typing required ;) It depends on which style once prefers I guess ;)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads