[fpc-pascal] how to initialize a SearchRec var?
    waldo kitty 
    wkitty42 at windstream.net
       
    Sun Jan  5 19:24:07 CET 2014
    
    
  
On 1/2/2014 6:31 PM, waldo kitty wrote:
> On 1/2/2014 2:52 PM, Sven Barth wrote:
>> Beginning with 2.7.1 you can use the new Default() intrinsic which takes a type
>> name as first and only argument (it returns a 0 initialized value of that type):
>
> 2.7.1 which means that we still have to respond to queries with older
> versions... ok, i think we can deal with that...
following up on this... this is what i came up with... is it right/proper?
   {$IF (FPC_FULLVERSION >= 20701)}
   {$INFO initializing dirinfo with Default(SearchRec)}
   dirinfo := default(searchrec);
   {$ELSE}
   {$PUSH}
   {$HINTS OFF}
   {$INFO initializing dirinfo with fillchar(dirinfo,sizeof(dirinfo),$00)}
   fillchar(dirinfo,sizeof(dirinfo),$00);
   {$POP}
   {$ENDIF}
-- 
NOTE: No off-list assistance is given without prior approval.
       Please keep mailing list traffic on the list unless
       private contact is specifically requested and granted.
    
    
More information about the fpc-pascal
mailing list