Forum OpenACS Q&A: Re: How to get a value from a tcl file to other tcl file

Collapse
Posted by Gustaf Neumann on
The preferred style is to write a function
ad_proc get_start_date {args} {
  This is a function returning ....
} {
   set count_num ...
   ...
   return $count_num
}
and load this function as a library file (in OpenACS under mypackage/tcl/myfunctions-procs.tcl ... assuming you have a package named mypackage). This function (here get_start_date) can be called from you web-pages or other library files.

Help this helps
-gn

Collapse
Posted by naveen cheguri on
Thanks @Gustaf Neumann for the quick reply.

I created an ad_proc as suggested by you.

My proc gets input parameters(args) from x.tcl, so I am calling my proc in x.tcl file, the return value of my proc(return $count_num) should be passed to y.tcl.

I dont know how to pass return value to y.tcl

I cannot call my proc in y.tcl, because y.tcl don't have my input arguments.

Please suggest me

Thanks