Click here to Skip to main content
16,004,647 members
Home / Discussions / C#
   

C#

 
AnswerRe: Wrting bytes to a file(xls) Pin
Justin Perez30-Aug-07 4:21
Justin Perez30-Aug-07 4:21 
GeneralRe: Wrting bytes to a file(xls) Pin
gauthee30-Aug-07 19:37
gauthee30-Aug-07 19:37 
AnswerRe: Wrting bytes to a file(xls) Pin
lmoelleb30-Aug-07 23:11
lmoelleb30-Aug-07 23:11 
QuestionMenuStrip Names Pin
topksharma198230-Aug-07 3:55
topksharma198230-Aug-07 3:55 
AnswerRe: MenuStrip Names Pin
Judah Gabriel Himango30-Aug-07 5:00
sponsorJudah Gabriel Himango30-Aug-07 5:00 
GeneralRe: MenuStrip Names Pin
topksharma198230-Aug-07 7:08
topksharma198230-Aug-07 7:08 
QuestionGeneral newbie type question Pin
shwaguy30-Aug-07 3:30
shwaguy30-Aug-07 3:30 
AnswerRe: General newbie type question Pin
Spacix One30-Aug-07 4:10
Spacix One30-Aug-07 4:10 
shwaguy wrote:

Classes: What should go into a class and what should stay out?

Everything in C# MUST be in a class.


shwaguy wrote:
Should my class for this return the processing results

and
shwaguy wrote:
Is it acceptable to have a class return some result but then call on the same class

Classes in C# can not return values, methods (functions) and properties (think externally accessible variable) can.


shwaguy wrote:
Should I just forget about "functions" and "sub-routines" and throw everything into classes?

your functions have to be contained in a class




For an example all of these sources do the same thing
namespace myApp
{
    class mainclass
    {
        static void Main(string[] args)
        {
            My_Function_();
        }
        public static void My_function_()
        {
            Console.WriteLine("My \"Function\" was called");
        }
    }
}


namespace myApp
{
    class mainclass
    {
        static void Main(string[] args)
        {
            myclass.My_Function_();
        }
    }
    class myclass
    {
        public static void My_function_()
        {
            Console.WriteLine("My \"Function\" was called");
        }
    }
}

namespace myApp
{
    class mainclass
    {
        static void Main(string[] args)
        {
            anothernamespace.myclass.My_Function_();
        }
    }
}
namespace anothernamespace
{
    class myclass
    {
        public static void My_function_()
        {
            Console.WriteLine("My \"Function\" was called");
        }
    }
}






-Spacix
All your skynet questions[^] belong to solved

GeneralRe: General newbie type question Pin
martin_hughes30-Aug-07 4:25
martin_hughes30-Aug-07 4:25 
GeneralRe: General newbie type question Pin
Spacix One30-Aug-07 4:53
Spacix One30-Aug-07 4:53 
JokeRe: General newbie type question Pin
PIEBALDconsult30-Aug-07 5:44
mvePIEBALDconsult30-Aug-07 5:44 
AnswerRe: General newbie type question Pin
shwaguy30-Aug-07 9:11
shwaguy30-Aug-07 9:11 
QuestionStrange Problem at writing file Pin
error140830-Aug-07 3:29
error140830-Aug-07 3:29 
AnswerRe: Strange Problem at writing file Pin
Spacix One30-Aug-07 3:59
Spacix One30-Aug-07 3:59 
GeneralRe: Strange Problem at writing file Pin
error140830-Aug-07 4:13
error140830-Aug-07 4:13 
GeneralRe: Strange Problem at writing file Pin
Spacix One30-Aug-07 4:18
Spacix One30-Aug-07 4:18 
GeneralRe: Strange Problem at writing file Pin
error140830-Aug-07 4:19
error140830-Aug-07 4:19 
GeneralRe: Strange Problem at writing file Pin
Spacix One30-Aug-07 4:55
Spacix One30-Aug-07 4:55 
GeneralRe: Strange Problem at writing file Pin
error140830-Aug-07 5:05
error140830-Aug-07 5:05 
GeneralRe: Strange Problem at writing file Pin
J4amieC30-Aug-07 5:09
J4amieC30-Aug-07 5:09 
GeneralRe: Strange Problem at writing file Pin
error140830-Aug-07 5:12
error140830-Aug-07 5:12 
GeneralRe: Strange Problem at writing file Pin
Spacix One30-Aug-07 5:14
Spacix One30-Aug-07 5:14 
GeneralRe: Strange Problem at writing file Pin
error140830-Aug-07 5:18
error140830-Aug-07 5:18 
GeneralRe: Strange Problem at writing file Pin
Spacix One30-Aug-07 5:59
Spacix One30-Aug-07 5:59 
GeneralRe: Strange Problem at writing file Pin
Luc Pattyn30-Aug-07 6:42
sitebuilderLuc Pattyn30-Aug-07 6:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.