Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-05

[Fwd: Returned mail: User unknown]

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Cliff Baeseman

To:
Subject: Returned mail: User unknown

Earlier message 69 lines
From: Mail Delivery Subsystem <MAILER-DAEMON> Date: Sun, 16 May 1999 23:03:34 -0500 (CDT) Auto-Submitted: auto-generated (failure) The original message was received at Sun, 16 May 1999 23:03:30 -0500 (CDT) from [208.198.3.211] ----- The following addresses had permanent fatal errors ----- ----- Transcript of session follows ----- ... while talking to harding.miraclec.com.: >>> RCPT To: <<< 550 ... User unknown 550 ... User unknown Reporting-MTA: dns; jasmine.pcpros.net Received-From-MTA: DNS; x2-1-ppp138.pcpros.net Arrival-Date: Sun, 16 May 1999 23:03:30 -0500 (CDT) Final-Recipient: RFC822; Action: failed Status: 5.1.1 Remote-MTA: DNS; harding.miraclec.com Diagnostic-Code: SMTP; 550 ... User unknown Last-Attempt-Date: Sun, 16 May 1999 23:03:34 -0500 (CDT) To: Subject: Losing valid object references... From: Cliff Baeseman Date: Sun, 16 May 1999 23:07:29 -0500 Sender: cliff Man I am just having a terrible time... I keep losing perfectly valid object references. Something like this.. TMyobj = class(TFORM) protected edit : TEdit; public procedure this; procedure that; end TMyObj.this; begin edit := TEdit.Create(Self); edit.text := 'this works' <-----this works just fine end; TMyObj.that; begin edit.Text := 'not cool'; <-----this is throwing a access violation ? end; I have checked everything I can possibly think of and cannot get stuff like this to work. I have been fighting access violations all day. If I check for assigned it evaluates true. Like the pointers are getting hosed up.. Not Happy ;( Cliff

Reply by email

Baeseman, Cliff

I wish it were my code that was causing the problem but it is also shane that is having trouble with the exact same thing as well as michael H.

Self is also being affected sometiomes its ok and sometimes it is not..

It is just like or refs are getting blown away.

Cliff

Earlier message 57 lines
-----Original Message----- From: Sent: Monday, May 17, 1999 2:48 PM To: Subject: [lazarus] initialized objects? Hello, On Sun, 16 May 1999 23:09:59 -0500, you wrote: >TMyObj.this; >begin > edit := TEdit.Create(Self); >edit.text := 'this works' <-----this works just fine >end; >TMyObj.that; >begin >edit.Text := 'not cool'; <-----this is throwing a access violation ? >end; >I have checked everything I can possibly think of and cannot get stuff >like this to work. I have been fighting access violations all day. >If I check for assigned it evaluates true. Like the pointers are >getting hosed up.. Cliff, "Assigned" only tell you that the pointer isn't nil. It can't tell you if the address is valid. I'm *not sure*... but I think that, at least in Delphi, you can trust that global variables are initialized to nil (all zeroes). Object fields are also nil if the object constructor executes TObject.Create first, which zero all fields. If not, you can't tell which the initial value will be, unless you explicitely assign nil in your constructor. Local variables are never guarranteed to be nil cause they're taken from the stack, that dynamically holds return addresses, parameters and so on. For object variables whose lifetime is longer than a function is a good programming practice (but by no means forced) to assign nil just after calling Free. Assigning nil in the constructor also helps to avoid errors. I encourage you to take this precautions at least while developing. I'm overworked now and most likely I will, during next three or four weeks. I hope to stay in touch, though greetings Nico _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Nicolas Aragon
to Cliff Baeseman: To: Subject: Returned mail: User unknown From: Mail Delivery Subsystem <MAILER-DAEMON>…

Hello,

you wrote 13 lines
TMyObj.this; begin edit := TEdit.Create(Self); edit.text := 'this works' <-----this works just fine end; TMyObj.that; begin edit.Text := 'not cool'; <-----this is throwing a access violation ? end; I have checked everything I can possibly think of and cannot get stuff like this to work. I have been fighting access violations all day. If I check for assigned it evaluates true. Like the pointers are getting hosed up..

Cliff, "Assigned" only tell you that the pointer isn't nil. It can't tell you if the address is valid.

I'm *not sure*... but I think that, at least in Delphi, you can trust that global variables are initialized to nil (all zeroes).

Object fields are also nil if the object constructor executes TObject.Create first, which zero all fields. If not, you can't tell which the initial value will be, unless you explicitely assign nil in your constructor.

Local variables are never guarranteed to be nil cause they're taken from the stack, that dynamically holds return addresses, parameters and so on.

For object variables whose lifetime is longer than a function is a good programming practice (but by no means forced) to assign nil just after calling Free. Assigning nil in the constructor also helps to avoid errors. I encourage you to take this precautions at least while developing.

I'm overworked now and most likely I will, during next three or four weeks. I hope to stay in touch, though

greetings

Nico

Reply by email