That may work, but that means you are touching local vars from within
a TCF method, which would be ok, but technically a bad habit. That is
what the <@varparam> tag is for. So:
<@callmethod local$myObject method="MyTCFFunc(<@varparam local
$myvariable>)">
Would be the proper way to do it. So if MyTCFFunc has only one
parameter, and is an in/out parameter, named "myParameter", then in
your tcf method, when you do <@assign method$myparameter "somevalue">
or <@setparam "myParameter" "someValue"> it will automatically the
varparam variable local$myvariable to "someValue" on the return of
the method.
--
Robert Garcia
President - BigHead Technology
VP Application Development - eventpix.com
13653 West Park Dr
Magalia, Ca 95954
ph: 530.645.4040 x222 fax: 530.645.4040
[EMAIL PROTECTED] - [EMAIL PROTECTED]
http://bighead.net/ - http://eventpix.com/
On Aug 8, 2005, at 12:03 PM, Alan Wolfe wrote:
it is possible to pass by reference or by value to a TCF function, but
probably not in the way you are used to:
-----------------------------------
here's how to pass by value:
MyTCFFunc("@@local$myvariable")
inside your tcf function, your function's parameter will contain the
value that local$myvariable did. you can do whatever you want to the
string and it wont change the origional variable.
-----------------------------------
here's an example of passing by reference:
MyTCFFunc("local$myvariable")
inside your tcf function, your function's parameter will contains the
value"local$myvariable", instead of the value of that variable.
Let's say your function's first param is called "local$myparam", you
can read/write the parameter like this, thus read/writing the actual
origional variable (thus you have essentialy passed the variable by
reference):
read the variable:
<@var name="@@local$myparam">
write:
<@assign name="@@local$myparam" value="value goes here">
-----------------------------------
Hope that helps!
Alan
On 8/8/05, Bill Conlon <[EMAIL PROTECTED]> wrote:
In the Studio, parameters passed by reference (as a variable) instead
of by value, cannot in method scope.
Does anyone understand this limitation? I have some methods that
manipulate strings in place, and I would like to use them within a
TCF.
But it looks like I have either pass by value, or copy to a request
scope variable. This seems
* inefficient
* potentially dangerous (could inadvertently clobber an existing
request scope variable).
Is this a bug?
_____________________________________________________________________
___
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
______________________________________________________________________
__
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf