0

I am new in this language.....but..i want to know this...

is VB-

you have SUB AND FUNCTION

Ths sub is just a procees...Doesnt return nothing...
and the function is that a function but returns a value


in Csharp...did you use sub and functions????

5
Contributors
8
Replies
9
Views
8 Years
Discussion Span
Last Post by dickersonka
0

No they are all "methods" the only difference is if you dont want to return anything you say it returns "void" eg nothing

0

I agree with LizR. C# is a C-like language, in C you have only functions, no subroutines.
When you want to "simulate" a subroutine in C, C# or C++ you use something like

void MyStuff()
{
     //do my stuff
}

When you use functions in a class you call them methods, but what's in a name?
Just use those "things" and happy programming!

0

and to extend upon ddanbe, you can also set the modifiers on the methods

public void MyStuff()
{
}

private void MyStuffAgain()
{
}

the access modifiers match except these
VB -> C# equivalent
Friend -> internal
Protected Friend -> internal protected

0

I am new in this language.....but..i want to know this...

is VB-

you have SUB AND FUNCTION

Ths sub is just a procees...Doesnt return nothing...
and the function is that a function but returns a value


in Csharp...did you use sub and functions????

No I give you and example to better understand

public sub x() = public void x ();
public shared sub x() = public static void x();
public Function x(byVal type a,ByRef type b) as type = public type x(type a, ref type b);

0

Jugortha, ByRef isn't always going to be c# ref, it will sometimes be out

if you aren't for sure, don't post information that may lead someone down the wrong path

0

Yes you have raison dikersonka but I try to simplify the existence to gooki2005

What on earth does that mean?

0

Lol i think its some sort of way to say yes you are correct, but I thought i had a way to help gooki understand.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.