Re: Why can't you define a variable as public within the Main() method?
- From: "Marc Gravell" <marc.gravell@xxxxxxxxx>
- Date: Wed, 20 Dec 2006 11:33:21 -0000
Saved me a job... the reason I mention it is that of course both
methods are now reading/updating the same "variable" (field). This can
be very bad and confusing in many scenarios (particularly threading),
but very elegant and tidy in others. Use with caution (esp. when
threading), but worth knowing about. I think it would be a lousy
solution to the OP's question, but worth mentioning for completeness.
Marc
.
- Follow-Ups:
- Re: Why can't you define a variable as public within the Main() method?
- From: Dave Sexton
- Re: Why can't you define a variable as public within the Main() method?
- References:
- Why can't you define a variable as public within the Main() method?
- From: garyusenet
- Re: Why can't you define a variable as public within the Main() method?
- From: Marc Gravell
- Re: Why can't you define a variable as public within the Main() method?
- From: Joanna Carter [TeamB]
- Re: Why can't you define a variable as public within the Main() method?
- From: Dave Sexton
- Why can't you define a variable as public within the Main() method?
- Prev by Date: Re: Why can't you define a variable as public within the Main() method?
- Next by Date: Re: Regex items in any order
- Previous by thread: Re: Why can't you define a variable as public within the Main() method?
- Next by thread: Re: Why can't you define a variable as public within the Main() method?
- Index(es):
Relevant Pages
|