PC Review


Reply
Thread Tools Rate Thread

delcaring variables to share in different methods

 
 
Paul
Guest
Posts: n/a
 
      12th Aug 2008
Hi I have a c# windows application vs2005 with a main section and two public
static methods.
Anyhow I am using the same variable in the main section as well as the
methods but in each case I had to create a new variable. Is there a way to
have the variable declared and set in Main and usable in the methods without
passing them into the methods? The methods would only need to read the
variable.
Thanks.
--
Paul G
Software engineer.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Naming Conventions of methods and variables vital Microsoft C# .NET 3 2nd Dec 2007 04:50 AM
.net 2.0 - unused class variables / methods Rob Meade Microsoft ASP .NET 4 6th Jul 2007 02:00 PM
passing variables between methods tonyDeBrasco Microsoft Excel Misc 0 27th Jul 2005 09:26 AM
sharing variables between methods tfsmag Microsoft ASP .NET 6 17th Jun 2005 04:17 PM
Static methods and variables =?Utf-8?B?dHJpbml0eXBldGU=?= Microsoft Dot NET Framework 4 18th Dec 2004 11:43 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:04 AM.