Re: [Lazarus] Assigning Class to object

2021-12-06 Thread Kostas Michalopoulos via lazarus

On 12/6/21 02:15, R.Smith via lazarus wrote:
Firstly the correct way of determinig class (as with your current 
solution) is like this:


   if (MyObj is TButton) then TButton(MyObj).OnMouseDown := tmethod (not 
important here)  else
   if (MyObj is TPanel)  then TPanel(MyObj).OnMouseDown := tmethod (not 
important here)  else

   //  etc...



One small detail is that the "is Thing" operator checks if the object 
belongs to the class hierarchy introduced by the Thing class, but not 
necessarily if it *is* of Thing type - it can be a subclass too. 
Sometimes this distinction is important, so in those cases instead of 
"is" you can use the ClassType property of objects (e.g. if 
MyObj.ClassType=TButton then ...).


(yeah the name of the operator is kinda optimistic in assuming Liskov 
substitution principle always applies, but in practice this is often not 
the case :-P)


In general assuming two f: TFoo and b: TBar objects with TBar being a 
subclass of TFoo, this code:


Writeln(f is TFoo, ' ', b is TFoo, ' ',
f.ClassType=TFoo, ' ', b.ClassType=TFoo);

Will write TRUE TRUE TRUE FALSE (ie, both f and b belong to the class 
hierarchy introduced by TFoo but only f is really TFoo and b is not).


Kostas
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] FpDebug with aarch64-linux

2021-12-06 Thread Gabor Boros via lazarus

Hi All,

FPC 3.3.1, Lazarus fixes_2_2, LazDebuggerFp installed and configured in 
Tools/Options.

If start the project got "Error starting process in debugger".
With gdb works as expected. Is FpDebug not supported on aarch64?

Gabor
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] FpDebug with aarch64-linux

2021-12-06 Thread Martin Frb via lazarus

On 06/12/2021 17:17, Gabor Boros via lazarus wrote:

Hi All,

FPC 3.3.1, Lazarus fixes_2_2, LazDebuggerFp installed and configured 
in Tools/Options.

If start the project got "Error starting process in debugger".
With gdb works as expected. Is FpDebug not supported on aarch64?



FpDebug only supports Intel/AMD 32/64 bit.

There is an remote "avr" extension (included, but must be installed), 
contributed (and currently worked on) by C. Crause.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus