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

2014-01-05 Thread waldo kitty
On 1/5/2014 6:26 PM, Sven Barth wrote: On 05.01.2014 19:24, waldo kitty wrote: 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} {

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

2014-01-05 Thread Sven Barth
On 05.01.2014 19:24, waldo kitty wrote: 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 m

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

2014-01-05 Thread waldo kitty
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 que

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

2014-01-03 Thread Graeme Geldenhuys
On 2014-01-03 09:46, Sven Barth wrote: > This way if the hints are switched off before that code is reached they > will stay off afterwards instead of being switched on. Interesting, thanks for the tip. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal ht

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

2014-01-03 Thread Sven Barth
Am 03.01.2014 10:34 schrieb "Graeme Geldenhuys" : > > On 2014-01-02 19:21, waldo kitty wrote: > > > > we do not want to turn off hints so how can we initialize dirinfo and make fpc > > happy? > > > I hate such hints too! This is what I did in my code to prevent that > unwanted hint. > > One part is

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

2014-01-03 Thread Sven Barth
Am 03.01.2014 08:36 schrieb "Mark Morgan Lloyd" < markmll.fpc-pas...@telemetry.co.uk>: > > Sven Barth wrote: >> >> On 02.01.2014 22:27, Mark Morgan Lloyd wrote: >>> >>> Sven Barth wrote: === code begin === var dirinfo: SearchRec; begin dirinfo := Default(Searc

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

2014-01-03 Thread Graeme Geldenhuys
On 2014-01-02 19:21, waldo kitty wrote: > > we do not want to turn off hints so how can we initialize dirinfo and make > fpc > happy? I hate such hints too! This is what I did in my code to prevent that unwanted hint. One part is the usage of an out parameter, and the second part is the {$HIN

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

2014-01-02 Thread Mark Morgan Lloyd
Sven Barth wrote: On 02.01.2014 22:27, 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); Not yet. It's on my ToDo list however si

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

2014-01-02 Thread Sven Barth
On 02.01.2014 22:27, 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); Not yet. It's on my ToDo list however since I implemented D

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

2014-01-02 Thread waldo kitty
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 pos

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

2014-01-02 Thread waldo kitty
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

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

2014-01-02 Thread Mark Morgan Lloyd
Sven Barth wrote: === code begin === var dirinfo: SearchRec; begin dirinfo := Default(SearchRec); Out of curiosity, does this work: var dirinfo: SearchRec= Default(SearchRec); -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his e

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

2014-01-02 Thread Sven Barth
On 02.01.2014 20:50, Florian Klämpfl wrote: Am 02.01.2014 20:21, schrieb waldo kitty: understanding that SearchRec has different formats for different OS targets, we've tried to use fillchar to initialize it to an empty record... unfortunately that does not remove the hint... instead the hint

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

2014-01-02 Thread Sven Barth
Sorry for quoting the whole message... hit the wrong key *blush* Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

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

2014-01-02 Thread Sven Barth
On 02.01.2014 20:21, waldo kitty wrote: understanding that SearchRec has different formats for different OS targets, we've tried to use fillchar to initialize it to an empty record... unfortunately that does not remove the hint... instead the hint points to the fillchar line... we do not want

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

2014-01-02 Thread Florian Klämpfl
Am 02.01.2014 20:21, schrieb waldo kitty: > > > understanding that SearchRec has different formats for different OS > targets, we've tried to use fillchar to initialize it to an empty > record... unfortunately that does not remove the hint... instead the > hint points to the fillchar line... > >

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

2014-01-02 Thread Jonas Maebe
On 02/01/14 20:21, waldo kitty wrote: understanding that SearchRec has different formats for different OS targets, we've tried to use fillchar to initialize it to an empty record... unfortunately that does not remove the hint... instead the hint points to the fillchar line... It is virtually im

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

2014-01-02 Thread waldo kitty
understanding that SearchRec has different formats for different OS targets, we've tried to use fillchar to initialize it to an empty record... unfortunately that does not remove the hint... instead the hint points to the fillchar line... we do not want to turn off hints so how can we initia