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????

Recommended Answers

All 8 Replies

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

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!

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

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);

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

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

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

What on earth does that mean?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.