Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I work with classes... what is this Module stuff? I thought that would of went away with VB6... a module isn't a class... are people using this in VB? Should they be? I wouldn't think so.
Posted

if you really can't avoid something "module-like" I would suggest using a class with static variables and methods

 

public class MyClass
{
  public static int GlobalVariable;
  private static int testProperty;

  public static void ShowMessage(string message)
  {
      Console.WriteLine(DateTime.Now.ToString("HH:mm:ss") + " -> " + message);
      MessageBox.Show(message);
  }

  public static int TestProperty
  {
     get{return testProperty;}
     set{testProperty = value;}
  }
}

 

but we have the prossiblity to write object oriented code - so why stick to the old concepts?

 

Andreas

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...