RE: Passing variables in UDF

2001-09-13 Thread Dave Watts
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

RE: Passing variables in UDF

2001-09-12 Thread Raymond Camden
is the Force, and a powerful ally it is. - 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

RE: Passing variables in UDF

2001-09-12 Thread Dave Watts
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. While I

RE: Passing variables in UDF

2001-09-12 Thread Jeremy Allen
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, since

Re: Passing variables in UDF

2001-09-10 Thread Michael Dinowitz
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,

RE: Passing variables in UDF

2001-09-10 Thread Raymond Camden
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 :

RE: Passing variables in UDF

2001-09-10 Thread Dave Watts
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

RE: Passing variables in UDF

2001-09-10 Thread Michael Dinowitz
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 CFSCRIPT function test(aVar) {

RE: Passing variables in UDF

2001-09-10 Thread Michael Dinowitz
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

Re: Passing variables in UDF

2001-09-10 Thread Howie Hamlin
They are passed by value. You can see this from this simple code: === cfscript function AddOne(n) { return n+1; } /cfscript cfset num=1 cfoutputn+1=#AddOne(num)#br num=#num#/cfoutput === HTH,

RE: Passing variables in UDF

2001-09-10 Thread Carlisle, Eric
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

RE: Passing variables in UDF

2001-09-10 Thread Shawn Grover
, 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 'standard

RE: Passing variables in UDF

2001-09-10 Thread Shawn Grover
of the string variable in the calling page. -- I shoulda looked it up sooner. Sorry... grins 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

RE: Passing variables in UDF

2001-09-10 Thread Dave Watts
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, based

RE: Passing variables in UDF

2001-09-10 Thread Michael Dinowitz
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