Input params of methods

Questions, tips and tricks and techniques for scripting in Servoy

Input params of methods

Postby xtsr » Sun Feb 08, 2004 10:07 am

Can you define input parameters for methods? So far i used globals and variables that i defined without the "var" infront to transfer values - it works, but this doesn't really look right (and is risky, too...).
It obviously works with Servoy functions, i just couldn't figure out how to do it with my own scripts...
Thanks!
xtsr
 
Posts: 101
Joined: Wed Jan 21, 2004 11:47 am

Postby pbakker » Sun Feb 08, 2004 11:56 am

Yes you can... It's described in the Help function of Servoy :D Just browse around in the help function, looking for Methods and you'll find the chapter on Passingvariables into methods.

As for how it works:

methodname('var1','var2') to pass the var's

And in the method:

var 1 = arguments[0]
var 2 = arguments[1]

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands


Return to Methods

Who is online

Users browsing this forum: No registered users and 33 guests