|
-
Aug 2nd, 2004, 01:50 PM
#1
Thread Starter
Frenzied Member
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.
-
Aug 2nd, 2004, 02:59 PM
#2
Thread Starter
Frenzied Member
I found out you have to write a class for all the public stuff.
-
Aug 2nd, 2004, 10:52 PM
#3
Fanatic Member
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.
-
Aug 4th, 2004, 07:31 AM
#4
Thread Starter
Frenzied Member
ah. that's even better thanks a bunch! global variable would be declared public as normal? or should I create a public shared property?
-
Aug 4th, 2004, 08:24 PM
#5
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|