#198199 - 2010-03-26 04:14 PM
Re: Implement Procedures
[Re: BillBarnard]
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Not sure what extra functionality you are looking for.
Functions that don't return anything are procedures, so the following will already work for example:
HelloWorld
HelloWorld()
HelloWorld("Foo")
Function HelloWorld(Optional $s)
"Hello "+$s+@CRLF
EndFunction
Pass-by-reference is regularly requested, and I'll second it (again).
|
Top
|
|
|
|
#198207 - 2010-03-26 04:51 PM
Re: Implement Procedures
[Re: BillBarnard]
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
That's trickier.
If your function does not return a value then it is equivalent to a VB Sub and you don't need to assign the function to a value. This functionality is already present.
The problem is that the implied action in KiXtart is to output the content of the stack to the console - this is how normal output works. In other words, if there is data on the stack and there is no operator left to perform an action on it then the intention is to display it.
Now, we could work around this by implementing a specific "PRINT" command to display output to the console or maybe introduce a suppression operator so for example if you preceded an expression (or function) with say the "#" character it suppresses the implied print action.
Seems like a lot of effort to avoid typing "$=" in front of a function to discard the output
|
Top
|
|
|
|
Moderator: Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart
|
0 registered
and 507 anonymous users online.
|
|
|