allvariables: How To

Questions, tips and tricks and techniques for scripting in Servoy

allvariables: How To

Postby tshepler » Thu Apr 30, 2009 12:09 am

This may be a nooby question, but I am trying to work with the allvariables collection on a form so I can reset their value to null, but I can't figure out the syntax. Can someone show me a simple method to nullify them?

this is what I tried:

var allvars=allvariables
for(i in allvars){
allvars[i]=null;
}

I can see the list of var names, but I can't figure out how to use that info.

Thanks.
tshepler
 
Posts: 23
Joined: Fri Feb 08, 2008 7:14 pm

Re: allvariables: How To

Postby Joas » Thu Apr 30, 2009 8:20 am

Try this:
Code: Select all
var allvars = allvariables;
for(i in allvars){
   forms.yourFormName[allvars[i]] = null;
}
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


Return to Methods

Who is online

Users browsing this forum: No registered users and 35 guests

cron