[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Array name as parameter
- Subject: Re: Array name as parameter
- From: Ray Ontko <rayo@ONTKO.COM>
- Date: Sun, 3 Jan 1999 16:03:34 -0500
- In-Reply-To: <368BCABC.B4FA2904@cyberus.ca> from Bruce Mitchell at "Dec 31, 98 02:04:29 pm"
Bruce,
Arrays cannot be passed as parameters to a procedure, sadly.
Even if you pass the name, you cannot "dereference" the name
to make a reference to the array itself (although that's an
interesting idea).
You might be able to do what you want by making clever use of
#include and #define to create a separate copy of the procedure
for each array you intend to use it with. This would allow
you to use a "procedure" with many different arrays, but still
have a single source module in which to define the logic of the
procedure.
Ray
P.S. Note, however, you CAN pass an array to an external C
routine (go figure), but I wouldn't recommend this unless you're
willing to compile and re-link this into your SQR image each time
you get a new SQR distribution. To learn more about this, look
at the "array" function under "LET", and at ufunc.c in the "lib"
directory of your SQR distribuition.
> Can anyone tell me if an array name can be passed to a procedure as a
> parameter and if so how do I refer to the array in a GET statement? I believe I
> can not pass the array as a parameter but what about the name?
>
> Bruce Mitchell
> Sierra Systems Consultants Inc.
>
----------------------------------------------------------------------
Ray Ontko | Ray Ontko & Co | "Time for a new signature line."
rayo@ontko.com | Richmond, In | See us at http://www.ontko.com/