PDA

Click to See Complete Forum and Search --> : Prodecures? and Call statements?


session
May 6th, 2003, 10:03 PM
I'm very curious... in VB .NET, we can write function and precedure by ourselves and use Call statement to call the precedures we write. Howbout in C#? Can we do the same thing?
Any help would be very appreciated and if this has been asked, I ask for the forgiveness for not searching carefullin' first! :)

hellswraith
May 6th, 2003, 10:42 PM
You can create your own methods in C#.


private void MyMethod1()
{
// code here
}


private int MyMethod2()
{
// code here
return myInteger;
}

// To call the above methods:

MyMethod1();

// And for the second, it returns an integer,
// so you must assign a value for the return.
int returnValue = MyMethod2();