Hello Jeremy,
Thanks u and others for info. I have done pointers in assembly but thats so long
ago I wont mention it here!

Since  there  is very little memory being used it would make sense to get rid of
the pointer thingy and just do it thusly no??

  TRegState = record
    TrialDays: Integer;
    Key, License: string;
    Registered: Boolean;
  end;

    procedure RegStatus(var Status: TRegState);

eg
        Rstate.Key := '';
        RegStatus(Rstate);



Then there is no need for memory allocation eh?
Al+





Monday, June 28, 2004, 4:34:16 PM, you wrote:
JC> Al. 

JC> You need to allocate the pointer some memory using "new" and free is
JC> with "Dispose".
JC> i.e.

JC>     New(RState)
JC>     Rstate^.key:='';
JC>     //or it might be
JC>     Rstate.key^:='';
JC>     //when all done 
JC>     Dispose(Rstate)

JC> Remembering that when you dispose it, its gone forever.
JC> Oh, because it's a pointer you need the ^ with the structure.
JC> I am doing this from memory, so I might be slightly wrong with the
JC> position of the ^ but it will help you anyway.

JC> Jeremy

JC> -----Original Message-----
JC> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
JC> On Behalf Of Alistair George
JC> Sent: Monday, 28 June 2004 15:57
JC> To: [EMAIL PROTECTED]
JC> Subject: [DUG] Records: Access Violation error


JC>   TPRegState = ^TRegState;
JC>   TRegState = record
JC>     TrialDays: Integer;
JC>     Key, License: string;
JC>     Registered: Boolean;
JC>   end;

JC> //Global var:
JC>   Rstate: TPRegstate;


JC> //In formshow:

JC>     Rstate.Key := '';  //AVErr here
JC>     RegStatus(Rstate);


JC> _______________________________________________
JC> Delphi mailing list
JC> [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi



-- 
Regards,
 Alistair+

_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to