Hi,
It's not clear what you want to do as you do not provide code.
A few hints only
A static variable cannot be declared inside a method
I assume you are coming from C++ ( or C to be more exact ) , what you do in
this case is declare a member variable, it will exist between calls to the
method which is your intended objective.
a const cannot be changed, it cannot appear in the left side of an
assignation. that's why you are getting that error.
You should not use static UNLESS you want that the value of it to persist
during the run of the application, and across all the instances of that
type.
Please post back if you still have doubt about this.
Cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Brahm" <br***@ficticous.org> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hello,
I am trying to do this in C# within a private void method but the value
keeps changing in each call. I tried to use const but i get compiler
errors.
const bool firstTime = true;
if( firstTime == true)
{
firstTime = false; // compiler does not like this
}
I get left hand side of an assignment must be a variable.
Thanks, Please tell me how to reply...
BRAHM
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!