recieving parameters (OpenInsight Specific)
At 05 SEP 2000 08:31:02PM Jeff wrote:
I have some problems receiving parameters-perhaps someone has a better idea at this than I do:
If I have an Inet procedure that looks like:
* Function INET_getparam (request) declare function Inet_QueryParam, inet_test A=Inet_QueryParam( Request, 'A' ) B=Inet_QueryParam( Request, 'B' ) A=hello world" VARHTML:= 'INET_test(request)'
For this procedure if I pass A=AREV" and B=OI" into inet_getparam()
but redefine A=hello world" and call inet_test(),
I don't get A=hello world" but get A=AREV" in inet_test().
Is there a way around this? I'm still new at this INET stuff so any help would be much appreciated.
-I've also tried :
VARHTML:= 'INET_test(request , ':A:')'
But that doesn't seem to work either.
Jeff
At 05 SEP 2000 09:19PM Don Bakke wrote:
Jeff,
Change your code from:
A=hello world" VARHTML:= 'INET_test(request)'
to:
A=hello world" Results=INET_test(A) VARHTML := Results
The first problem was that you enclosed a function call within quotes. This causes OI to think you are creating a literal. The second problem is that you were not passing your variable/parameter A into your INET_Test function. Finally, FYI, you can name your functions anything you want as long as they will only be called from within your INET procedures. Only procedures that need to be executed directly from a web page need the INET prefix.
dbakke@srpcs.com
At 05 SEP 2000 10:36PM Jeff wrote:
Don thanks for the great advice!
Like you were saying, when I have an Inet procedure and I want a call to another (non-INET) procedure internally, would i use the call function?
ie.
*
function inet_getparam(request)
A=Hello world"
call test(A,B)
and if I want A and B to be returned to inet_getparam()
would I write in the test function:
return A
return B
? I seem to be confused on how to move these parameters back and forth.
Many thanks!
-Jeff
At 06 SEP 2000 01:03AM Don Bakke wrote:
Jeff,
Based on what you are describing you really need a subroutine (there is really no difference other than a function is supposed to return a single value to a new variable.) In either case, if you pass your variables to another routine, modify their contents there, then those variables will have the modified values when you get back to the calling program. For instance…
*
function inet_getparam(request)
A=Hello world"
call test(A,B)
…is perfectly fine as is. Using the "call" statement means that "test" is being executed as a subroutine. When "test" is completed and returns to "inet_getparam" then "A" and "B" will have any changes that "test" made to them.
dbakke@srpcs.com