Results 1 to 5 of 5

Thread: vb modules RESOLVED

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    vb modules RESOLVED

    In vb, you can create a 'module' to hold all public functions, sub, variables and etc. in c#, is that the same as a 'code file'?
    Last edited by Andy; Aug 2nd, 2004 at 03:00 PM.

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    I found out you have to write a class for all the public stuff.

  3. #3
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    you can create a class with static methods mate. just like having Console.WriteLine(); writeline is a static member method of the console class. you can do no instantiation of the class
    PHP Code:
    using System;
    class 
    sampleClass{
       static 
    void Main(){
          
    moduleClass.print("hello world");
       }
    }
    class 
    moduleClass{
       public static 
    void print(string s){
          
    Console.WriteLine(s);
       }

    hope this helps mate.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    ah. that's even better thanks a bunch! global variable would be declared public as normal? or should I create a public shared property?

  5. #5
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    well i'm no expert mate. hehe. i guess it's your choice mate. we both on the same direction. but i haven't encounter global variable declaration much. me dunno mate,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width