Passing Values to Global Methods

Questions, tips and tricks and techniques for scripting in Servoy

Passing Values to Global Methods

Postby tommygill » Wed Jan 19, 2011 11:08 pm

Hi All

I have a global method nested inside a local onDataChanged method. I need to pass the "oldValue, newValue, event" values to the global method. Is this possible?

Thanks for your help.
Tom

Mac OS X 10.6.7
Servoy version 5.2.0 -build 997
Java Version 1.6.0_20
User avatar
tommygill
 
Posts: 110
Joined: Thu Jan 27, 2005 1:38 pm
Location: Columbus, Indiana, USA

Re: Passing Values to Global Methods

Postby Joas » Wed Jan 19, 2011 11:24 pm

You mean like this?
Code: Select all
function onDataChange(oldValue, newValue, event) {
   //some code

   globals.yourGlobalMethod(oldValue, newValue, event);

   //more code
}
Joas de Haan
Yield Software Development
Need help on your project? yieldsd.com
User avatar
Joas
Site Admin
 
Posts: 842
Joined: Mon Mar 20, 2006 4:07 pm
Location: Leusden, NL

Re: Passing Values to Global Methods

Postby tommygill » Thu Jan 20, 2011 12:51 am

Thanks Joas

Yes. Like this.

Code: Select all
function onDataChange(oldValue, newValue, event) {

   globals.yourGlobalMethod(oldValue, newValue, event);

   //some code
}


It works fine now. Thanks for the help.
Tom

Mac OS X 10.6.7
Servoy version 5.2.0 -build 997
Java Version 1.6.0_20
User avatar
tommygill
 
Posts: 110
Joined: Thu Jan 27, 2005 1:38 pm
Location: Columbus, Indiana, USA


Return to Methods

Who is online

Users browsing this forum: No registered users and 10 guests