[fpc-devel] [patch] regex.pp with out parameters
Graeme Geldenhuys
graemeg.lists at gmail.com
Fri Mar 27 13:07:07 CET 2009
On Fri, Mar 27, 2009 at 1:57 PM, Joost van der Sluis <joost at cnoc.nl> wrote:
>>
>> The patch simply changes the 'var' parameters to 'out' parameters.
>
> It surely fixes the warning, but not the problem? Doesn't 'out' generate
> faster code in this case? And shoudn't the error be always set? To 0 if
> no error occured or something else if there really is an error?
Well, I was simply working on the warning issue. I hate compiler
warnings or hints in my code. :-) Looking at the Parse() method, it
never reads the parameters, it only ever sets them. Hence the idea of
using the 'out' parameters.
If the Parse() was successful, it does the following:
Result := true;
aErrorPos := 0;
aErrorCode := recNone;
On any errors, other values are set.
Regards,
- Graeme -
_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
More information about the fpc-devel
mailing list