We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › define global Constants
Page Index Toggle Pages: 1
define global Constants? (Read 1850 times)
define global Constants?
Dec 23rd, 2009, 8:23am
 
Hello,

at the moment I try to define global Constants.

E.g.

int Umbrella = 0;

How can I make it a constant to use in a switch-statement as a label?

Thanks!

Greetings,

Chris


Re: define global Constants?
Reply #1 - Dec 23rd, 2009, 8:32am
 
Put final in front of it.
Re: define global Constants?
Reply #2 - Dec 24th, 2009, 6:37am
 
As in

Code:
final int Umbrella = 0; // Constant, cannot be modified 

Re: define global Constants?
Reply #3 - Jan 7th, 2010, 8:34am
 


Thank you!!!

Page Index Toggle Pages: 1