> Lets look at the difference between a function that works on
> variables vs. one that works on an array. ucase(attribute)
> returns the attribute after it has been made all uppercase.
> ArrayResize(array, minimum_size) - this will resize the array
> that you pass to it. The array is NOT retur
>
>Of course, in the long run, it really doesn't matter, as long as we know
>what behavior to expect. However, there are useful benefits to passing
>structures by reference to custom tags. For example, let's say we wanted to
>filter input. Ideally, we could use an external component for that, sinc
> > > Are variables passed by reference or by value in CF UDFs?
> >
> > Queries, structures, and variables created using CFOBJECT
> > are passed by reference. Other variables are passed by value.
> > This is true whether passing them to UDFs or custom tags or
> > whatever, as far as I can tell.
ot; - Yoda
> -Original Message-
> From: Michael Dinowitz [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 10, 2001 3:44 PM
> To: CF-Talk
> Subject: RE: Passing variables in UDF
>
>
> While I can understand this in a UDF, I just can't understand
> why this is
Lets look at the difference between a function that works on variables vs.
one that works on an array.
ucase(attribute) returns the attribute after it has been made all uppercase.
ArrayResize(array, minimum_size) - this will resize the array that you pass
to it. The array is NOT returned as a fu
> I was wrong in saying that an array was passed by reference.
> I just tested it out and it is passed by value. I was assuming
> based on the normal array function results that it would be. I
> hate when things are not 'standard'.
I'm not sure I understand what you mean by this (that is, "bas
string
variable in the calling page.
--
I shoulda looked it up sooner. Sorry...
Shawn Grover
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 10, 2001 1:35 PM
To: CF-Talk
Subject: RE: Passing variables in UDF
I was
, September 10, 2001 1:35 PM
To: CF-Talk
Subject: RE: Passing variables in UDF
I was wrong in saying that an array was passed by reference. I just tested
it out and it is passed by value. I was assuming based on the normal array
function results that it would be. I hate when things are not 'sta
Thanks, Micheal.
I appreciate taking the time to do the fieldwork :).
EC
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 10, 2001 3:35 PM
To: CF-Talk
Subject: RE: Passing variables in UDF
I was wrong in saying that an array was
They are passed by value. You can see this from this simple code:
===
function AddOne(n)
{
return n+1;
}
n+1=#AddOne(num)#
num=#num#
===
HTH,
Howie Hamlin - inFusion Project Manager
On-Line Dat
While I can understand this in a UDF, I just can't understand why this is
true for a custom tag. I just tried it out and an array is passed by value
to a custom tag. A structure is passed by reference. This totally breaks
the paradigm of custom tags being "totally independent processes".
At 03
I was wrong in saying that an array was passed by reference. I just tested
it out and it is passed by value. I was assuming based on the normal array
function results that it would be. I hate when things are not 'standard'.
Causes an error
function test(aVar)
{
> Are variables passed by reference or by value in CF UDFs?
Queries, structures, and variables created using CFOBJECT are passed by
reference. Other variables are passed by value. This is true whether passing
them to UDFs or custom tags or whatever, as far as I can tell.
Dave Watts, CTO, Fig Lea
If the var is simple or array, then it is by value. If you pass in a
struct or a query, then it is by ref.
===
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia
Email: [EMAIL PROTECTED]
Yahoo IM : morpheus
Simple variables are passed by value. Complex variables (query, structure,
array) are passed by reference. I think that object variables are also
passed by reference.
At 01:24 PM 9/10/01, you wrote:
>Are variables passed by reference or by value in CF UDFs?
>
> Thanks,
>
>
~
15 matches
Mail list logo