Local variables

Discuss all feature requests you have for a new Servoy versions here. Make sure to be clear about what you want, provide an example and indicate how important the feature is for you

Local variables

Postby anton.dorrestijn » Thu Dec 09, 2004 3:31 pm

Hello,

In 60% of my coding I miss "local variables". By local I mean a variable that is only declared withing a Form object.

We have only "method variables" and "global variables"


Anton
anton.dorrestijn
 
Posts: 15
Joined: Wed Sep 08, 2004 10:47 pm

Postby patrick » Thu Dec 09, 2004 4:40 pm

If you mean you miss a "form variable", there is none. And if there was: where would you declare that?
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Postby anton.dorrestijn » Thu Dec 09, 2004 6:45 pm

Hello Patrick

where would you declare that?


The same way as the global variable is declared..?

Only one difference, it should follow the javascript datatypes!

Anton
anton.dorrestijn
 
Posts: 15
Joined: Wed Sep 08, 2004 10:47 pm

Postby IT2Be » Fri Dec 10, 2004 9:31 am

anton, what you can do is just 'use' the variable without declaring it.
that way the variable is made global but you don't have to declare them.

Just remember to set them to null when you leave the form and the variable is 'gone'...

Cheers,

marcel
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby jcompagner » Mon Dec 13, 2004 12:28 pm

try playing with:

var x = 10;
and

y = 10;

in youre scripts.

You will see a difference.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby anton.dorrestijn » Mon Dec 13, 2004 6:05 pm

Thanks Marcel and Johan,

Your sollution seems to work, but it doesn't.

When you load the form in let's say an tabpanel, everything is messed up bad.

So it's not an advisable approach...

Anton
anton.dorrestijn
 
Posts: 15
Joined: Wed Sep 08, 2004 10:47 pm

Postby IT2Be » Mon Dec 13, 2004 6:24 pm

Can you please be more clear Anton. I use this frequently without issues so it should work...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby martinh » Mon Sep 10, 2007 11:24 am

I posted this request also.
Later I saw you had this request also
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium

Postby olivier melet » Tue Sep 11, 2007 9:59 am

Hi Anton,

please have a look to this topic, think you'll get some answers...

http://forum.servoy.com/viewtopic.php?t=8755

According to servoy, locals (form variables) may be introduced by version 4.

At that moment, we use a workaround, by defining a new property (private property) into the form object. We then stock information into that property. Hope this helps...
Olivier Melet
Administration et projets
InfoForm SA
olivier melet
 
Posts: 183
Joined: Mon Apr 19, 2004 3:33 pm
Location: Switzerland


Return to Discuss Feature Requests

Who is online

Users browsing this forum: No registered users and 13 guests

cron