The question is -- do you need any inputs for the computation that
computes the value? If not (e.g. you are invoking a random number
generator), you can jus tdo
static val level : int = computeDefault();
If it needs arguments, then you have to somehow get those arguments
there. The best way to do that is to use instance fields.
On 2/20/2012 4:22 PM, Marc Tajchman wrote:
Hi,
Sorry if it's a stupid question:
I use a static field :
class Debug {
static val level : int = <some_value>;
....
};
Here the static field value is known at compile time (needs
recompilation each time the value changes)
Is it possible to specify it at run time ? The value may be different
at each run, but remains constant during one run.
I prefer to use a (global) static value so I don't have to propagate
explicitely an object everywhere.
Thanks for any advice
Marc
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users