[fpc-pascal] how to initialize a SearchRec var?

waldo kitty wkitty42 at windstream.net
Fri Jan 3 00:35:05 CET 2014


On 1/2/2014 4:27 PM, Mark Morgan Lloyd wrote:
> Sven Barth wrote:
>> === code begin ===
>>
>> var
>>   dirinfo: SearchRec;
>> begin
>>   dirinfo := Default(SearchRec);
>
> Out of curiosity, does this work:
>
> var
>     dirinfo: SearchRec= Default(SearchRec);

+1 ;)

what i run into is porting old code and trying to possbly also make it 
multi-platform... the biggest gotcha we've run into is those typed constants 
that are used to hold values between executions of a routine... those should be 
initialized to a zero/empty value before first execution but then retain their 
values afterward...

-- 
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