For Programmers: Free Programming Magazines  


Home > Archive > Delphi > April 2005 > initialise class members to zero









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author initialise class members to zero
ginzel

2005-04-14, 5:56 pm

Hello!

How to write this coreactly and/or better in Delphi7?

type
class TSomeClass
first_var: Integer;
// lots of vars of different types
last_var: Double;
constructor Init(); override;
end;



constructor TSomeClass.Init(); override;
begin
FillMem(AddressOf(first_var), AddressOf(last_var)-AddressOf(first_var), 0);
last_var := 0;
end;

Thanks
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com