PureBytes Links
Trading Reference Links
|
> From omega-list-request@xxxxxxxxxx Sun May 30 11:41:08 1999
> Resent-Date: Sun, 30 May 1999 11:40:25 -0700
> Mime-Version: 1.0
> X-Sender: bfulks@xxxxxxxxxxxx
> Date: Sun, 30 May 1999 14:39:13 -0400
> To: "Chris Edwall" <cedwall@xxxxxxxx>
> From: Bob Fulks <bfulks@xxxxxxxxxxxx>
> Subject: Re: EasyLanguage Functions
> Cc: <omega-list@xxxxxxxxxx>
> Does anyone know a way to return 2 values from an EasyLanguage function?
In TS2000i, I think you can use reference parameters. I haven't tried
it myself.
A reference parameter passes the address of a variable rather than the current
value of the variable to the function. When a value is passed as a parameter,
it is copied into a new memory address. Thus, any refernce to it, including
changing its value, is not seen by the calling routine. However, when an
address is passed as a paramter, this is the same address that the calling
routine uses. Thus, any changes are observable by both the function and the
calling routine.
An interesting aside, very old Fortran compilers put constants into a
memory address. Since all parameters were passed by reference, it was
possible for a routine to pass a constant to a subroutine, the subroutine
would assign it a parameter name (e.g., two), then assign the value 3 to the
variable two. This would change the constant 2 to 3 in the calling routine!
>From then on, when you referred to 2 you got 3.
Chris Norrie
|