[Lazarus] Some syntax changes
Mattias Gärtner
nc-gaertnma at netcologne.de
Sat Jul 31 17:39:02 CEST 2010
Zitat von Hans-Peter Diettrich <DrDiettrich1 at aol.com>:
> Mattias Gaertner schrieb:
>
>>> A simple example:
>>>
> interface
>>> function GetProp: byte;
>>> var
>>> test: integer;
>>> property
>>> prop1: byte read GetProp;
>>> prop2: byte read GetProp;
> implementation
> function GetProp: byte;
> begin
> Result := 0; //whatever you like. check code completion for "Result"
> end;
Fixed.
> [...]
>>>>> The usage of an function name instead of the Result variable has
>>>>> been restricted. For some reason Lazarus now rejects "Result" in
>>>>> code completion, even if it is accepted by the compiler.
>>>> Can you give an example or better: the definition?
>>> This happened to me in a property getter function, i.e. in the
>>> GetProp implementation in above example. So it may be related to
>>> the above property problem.
>>
>> I don't know. The above does not compile.
>
> Please try again.
function GetProp: byte;
begin
Result := 0; //whatever you like. check code completion for "Result"
end;
It works here.
Mattias
More information about the Lazarus
mailing list