Functions and references
-
i have two classes, one serverCommands and one socketServer. once i have created a new instance of the serverCommands class in socketServer, i want to be able to type something like serv (my new instance of serverCommands) .CreateSocket(socketName) and create a socket according to the name specified. is this possible? :confused: if so, how? this could be used with other stuff two as there is some things that would be much quicker to create with a function. should the functions be private, public, static or what? (and what do they mean? :-O) also is it possible to say something like Console.WriteLine(serv.Version()); and have it getting an output from the function Version and displaying it in the Console? i understand references have something to do with this, and returns...:~ :rolleyes: thanks for help with any of the above, surgeproof:) ------------------------------------------------------- ithium is the best. 'Science without religion is lame, religion without science is blind.' --Albert Einstein 'The pioneers of a warless world are the youth who refuse military service.' --Albert Einstein
-
i have two classes, one serverCommands and one socketServer. once i have created a new instance of the serverCommands class in socketServer, i want to be able to type something like serv (my new instance of serverCommands) .CreateSocket(socketName) and create a socket according to the name specified. is this possible? :confused: if so, how? this could be used with other stuff two as there is some things that would be much quicker to create with a function. should the functions be private, public, static or what? (and what do they mean? :-O) also is it possible to say something like Console.WriteLine(serv.Version()); and have it getting an output from the function Version and displaying it in the Console? i understand references have something to do with this, and returns...:~ :rolleyes: thanks for help with any of the above, surgeproof:) ------------------------------------------------------- ithium is the best. 'Science without religion is lame, religion without science is blind.' --Albert Einstein 'The pioneers of a warless world are the youth who refuse military service.' --Albert Einstein
This is all possible if you design your application right. It's your implementation. As far as the access modifiers, you need to decide if you want any class to be able to call a method or get/set a property or not. You can see the differences between the access modifiers by reading Access Modifiers[^] in the Visual C# product documentation.
Microsoft MVP, Visual C# My Articles
-
This is all possible if you design your application right. It's your implementation. As far as the access modifiers, you need to decide if you want any class to be able to call a method or get/set a property or not. You can see the differences between the access modifiers by reading Access Modifiers[^] in the Visual C# product documentation.
Microsoft MVP, Visual C# My Articles
thanks for the link, it helps. would you have a link to teach me about functions/etc. and referencing? i can't seem to find anything useful, so if you do know of a good one please tell. thanks, surgeproof ------------------------------------------------------- ithium is the best. 'Science without religion is lame, religion without science is blind.' --Albert Einstein 'The pioneers of a warless world are the youth who refuse military service.' --Albert Einstein
-
thanks for the link, it helps. would you have a link to teach me about functions/etc. and referencing? i can't seem to find anything useful, so if you do know of a good one please tell. thanks, surgeproof ------------------------------------------------------- ithium is the best. 'Science without religion is lame, religion without science is blind.' --Albert Einstein 'The pioneers of a warless world are the youth who refuse military service.' --Albert Einstein
Nothing useful? How about reading the .NET Framework SDK[^] for starters, not to mention any number of the countless books out there about the .NET Framework and the languages that target it, like C#? It's how many of us learned.
Microsoft MVP, Visual C# My Articles
-
Nothing useful? How about reading the .NET Framework SDK[^] for starters, not to mention any number of the countless books out there about the .NET Framework and the languages that target it, like C#? It's how many of us learned.
Microsoft MVP, Visual C# My Articles
thanks. will try :) surgeproof ------------------------------------------------------- ithium is the best. 'Science without religion is lame, religion without science is blind.' --Albert Einstein 'The pioneers of a warless world are the youth who refuse military service.' --Albert Einstein