Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread function parameter can change?
Tue, Jun 14 2016 10:32 PMPermanent Link

kentersoft

how to change function parameter,  below test aStrParam is not change

function TestParam(const aValue: String; aStrParam: string): boolean;

function TestParam(const aValue: String; aStrParam: string): boolean;
begin
  result := True;
  aStrParam := aValue + ' extras';
end;

change define to
  function TestParam(const aValue: String; var aStrParam: string): boolean;
or
  function TestParam(const aValue: String; out aStrParam: string): boolean;
can not compile.

thanks!
Wed, Jun 15 2016 4:09 AMPermanent Link

Matthew Jones

kentersoft wrote:

> var

You cannot do this at all. Parameters are not changeable, due to
Javascript limitations. So, either have it as a member of a class and
have another result property, or pass a class that can have members
changed, or find another way to handle it. The multitude of
alternatives means this is not a show stopper.

--

Matthew Jones
Wed, Jun 15 2016 8:25 AMPermanent Link

kentersoft

<
You cannot do this at all. Parameters are not changeable, due to
Javascript limitations. So, either have it as a member of a class and
have another result property, or pass a class that can have members
changed, or find another way to handle it. The multitude of
alternatives means this is not a show stopper.
>

Ok, need learn more things, thank you!
Image