How to write parameterized method or How to pass parameter to method ?

rated by 0 users
This post has 1 Reply | 1 Follower

Top 500 Contributor
Posts 4
Points 80
Revansidh Posted: Tue, May 26 2009 4:08 AM

I want to write a method/function that will contain some parameter.

How to use these parameter in the coding ?

And also how to call this parameterized method from any method or on any event.

 

Thank you....

Top 25 Contributor
Posts 86
Points 1,295
tstickel replied on Wed, May 27 2009 8:47 AM

The code snippet below is the client code to call a server method and send 2 parameters:

var innovator  = this.newInnovator();
var res = innovator.applyMethod("mymethod","<parm1>123456</parm1><parm2>ABCDE</parm2>");
alert(res.getResult);

In the above code, you can use any xml node names you choose.  The server method will have code similar to:

Dim parm1 As String = Me.getProperty("parm1")

Dim parm2 As String = Me.getProperty("parm2")

Dim res As Item = myInnovator.newResult(parm1 + parm2)
Return res

See Programmer's Guide for example of calling a client method.

Terry Stickel, PDM Consultant

TStickel Consulting

Sanibel, Florida

  • | Post Points: 5
Page 1 of 1 (2 items) | RSS