Sign in Join

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

Mailing lists / lazarus / 2013-01

Class never seems to be initialized

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

ik

Hello,

I have a very weird problem:

I have a class as a property of another class.
I initialize it, but when checking if it was assigned, I get always false (both at:
https://github.com/ik5/split_lazarus/blob/master/src/untlazsplitview_code.pas#L189 and https://github.com/ik5/split_lazarus/blob/master/src/untlazsplitview_code.pas#L285)

I can't figure out what am I missing or doing wrong. I tried at the beginning to use a record, and it was the same problem, so I moved to a class, because
I thought it was a memory allocation issue, but the problem remains.

I'm using Lazarus 1.1 SVN Revision: 40007M with FPC 2.6.0 on Arch Linux x86_64

Ido

Reply by email

Martin
to ik
ik wrote 15 lines
Hello, I have a very weird problem: I have a class as a property of another class. I initialize it, but when checking if it was assigned, I get always false (both at: https://github.com/ik5/split_lazarus/blob/master/src/untlazsplitview_code.pas#L189 and https://github.com/ik5/split_lazarus/blob/master/src/untlazsplitview_code.pas#L285) I can't figure out what am I missing or doing wrong. I tried at the beginning to use a record, and it was the same problem, so I moved to a class, because I thought it was a memory allocation issue, but the problem remains.

Is it both time the same tab object?
Maybe debugln its address.

Also, if you run in the debugger, you can set a watchpoint, after you initialized it, and the debugger will break, if it is modified.

Reply by email

ik
to Martin
Martin wrote 21 lines
On 28/01/2013 21:04, ik wrote: > > Hello, > > I have a very weird problem: > > I have a class as a property of another class. > I initialize it, but when checking if it was assigned, I get always > false (both at: > > https://github.com/ik5/split_lazarus/blob/master/src/untlazsplitview_code.pas#L189 > and > https://github.com/ik5/split_lazarus/blob/master/src/untlazsplitview_code.pas#L285) > > I can't figure out what am I missing or doing wrong. > I tried at the beginning to use a record, and it was the same problem, > so I moved to a class, because > I thought it was a memory allocation issue, but the problem remains. > Is it both time the same tab object?

Yes, it is, the same variable also that is passed to the methods as a parameter.

Maybe debugln its address.

I'll try that, thanks

Show quoted text 11 lines
Also, if you run in the debugger, you can set a watchpoint, after you initialized it, and the debugger will break, if it is modified. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email