[fpc-pascal] Warning: Variable xxx does not seem to be initialized

Marcos Douglas md at delfire.net
Tue Dec 31 21:51:02 CET 2013


On Tue, Dec 31, 2013 at 6:20 PM, Sven Barth <pascaldragon at googlemail.com> wrote:
> On 31.12.2013 15:09, Marcos Douglas wrote:
>>
>> On Tue, Dec 31, 2013 at 6:33 AM, Sven Barth <pascaldragon at googlemail.com>
>> wrote:
>>>
>>> Am 31.12.2013 00:48 schrieb "Dmitry Boyarintsev"
>>> <skalogryz.lists at gmail.com>:
>>>
>>>
>>>>
>>>> Some new syntax has to be introduced to avoid the warning. Something
>>>> like:
>>>>
>>>> type
>>>>    TMyRec = record
>>>>      record procedure Print;
>>>>    end;
>>>>
>>>> record procedure TMyRec.Print;
>>>> begin
>>>>    writeln('foo');
>>>> end;
>>>
>>>
>>> We don't need a new syntax for something that already works:
>>>
>>> === code begin ===
>>>
>>> type
>>>   TMyRec = record
>>>      class procedure Print; static;
>>>    end;
>>>
>>> class procedure TMyRec.Print;
>>>
>>>
>>> begin
>>>   writeln('foo');
>>> end;
>>>
>>> begin
>>>    TMyRec.Print;
>>> end.
>>>
>>> === code end ===
>>>
>>> Regards,
>>> Sven
>>
>>
>> Yes, but if is need to use like this, is better using the sintaxe
>> Unit.Function...
>
>
> Depends on the preference of the developer I'd say. I personally prefer the
> usage of "typename.method" instead of "unit.function" for example.

Me too, but without warnings.  ;-)

I prefer to group procedures/functions (utilities) inside
object/record (in classes too, of course) instead using unit.function
sintaxe. IMHO the code is more readable and organized.

Regards,
Marcos Douglas



More information about the fpc-pascal mailing list