> On Jun 22, 2018, at 12:24 PM, Sven Barth via fpc-pascal 
> <fpc-pascal@lists.freepascal.org> wrote:
> 
> If $Assertions is set to Off the complete Assert() line will be absent from 
> the compiled code.


Good to know thanks.


Here’s an example of something I’ve seen for debugging. I think that was kind 
of cool you could print types like that and I’m not sure how that would work in 
Pascal if at all. Maybe some RTTI magic perhaps.

{$define typestr(t):='#t: '+IntToStr(sizeof(#t))}

program macro_test;
uses
        SysUtils;

type
        MyRecord = record
                x, y, z: single;
        end;

begin
        writeln(typestr(MyRecord)); // MyRecord: 12
end.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to