Newbie Servoy 6 question

Questions, tips and tricks and techniques for scripting in Servoy

Newbie Servoy 6 question

Postby dpearce » Wed Aug 03, 2011 8:33 pm

Sorry, I have not touched 6 since Jan's demonstration in February.

The new rules with regards to variables, give me 3773 warnings mainly for duplicates.

is the correct way to go about things to declare all variables at the beginning of an individual functions, or should they simply be declared as form variables. I am talking for use in scripts

Sorry for the stupid question!

David
dpearce
 
Posts: 469
Joined: Sun Dec 03, 2006 11:53 am

Re: Newbie Servoy 6 question

Postby jcompagner » Thu Aug 04, 2011 9:52 am

you mean:
Code: Select all
if (something)
{
   var myvariable = 10;
}
else
{
  var myvariable = 10;
}


that is in javascript really the same variable it is always declared at the function level so yes you could declare it just above the if
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Methods

Who is online

Users browsing this forum: Bing [Bot] and 18 guests