[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Easy Language Question



PureBytes Links

Trading Reference Links

At 12:03 PM -0400 8/13/99, Andrew wrote:

>Is it possible to create a function which returns multiple values.
>For Example, suppose you have written a function which calculates the
>last high, which higher than the previous 2 highs and higher than the
>following 2 highs, and you want to return both the price of this high
>as well as the date of this high.
>
>I realize you can accomplish this without having to return 2 values,
>but this was a straightforward example for my question.


TS4.0 will only allow you to return one value but you can call the 
function twice with an input to specify which value you would like to 
return:

-------

Function code for function "Sample"

Input: Mode(NumericSimple), <other inputs>;

<Function code>

if Mode = 1 then Sample = <first value> else
if Mode = 2 then Sample = <second value>;

-------

Calling program:

Value1 = Sample(1, <other inputs>);
Value2 = Sample(2, <other inputs>);

-------

Bob Fulks