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 parameters can only be const?
Mon, May 6 2013 10:12 PMPermanent Link

Stephen Barker

Hi,

I notice that in function parameter declarations,

"var myVar : integer"       is not allowed
"const myVar : integer"   is allowed
"myVar : integer"            is allowed

None of these allow returning a value after the function is called - is that by design?

I have a function that returns an object (TPanel) in the result variable, but I would also like to return it's ordinal position in the controls array as an integer var parameter.

e.g.
function TfrmMain.GetPanelByTag(const t : integer; indx : integer) : TPanel;
...

Steve
Tue, May 7 2013 7:35 AMPermanent Link

Matthew Jones

I asked about this before, and it seems that Javascript can't do var. Thus neither
can EWB. An old days hack like using a member variable will of course work around
this.

/Matthew Jones/
Tue, May 7 2013 4:41 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Stephen,

<< None of these allow returning a value after the function is called - is
that by design? >>

Yes - JavaScript doesn't support variable parameters, so initially it was
left out of the compiler until I can come up with a solution with reasonable
performance.

Tim Young
Elevate Software
www.elevatesoft.com
Image