|
-
Jul 29th, 2002, 12:01 PM
#1
C# to VB .NET tips
Thought I would share a few tips with you guys on C# to VB .NET conversion. You will note that alot of examples are in C# so knowing these will help you when looking at C# code to convert it to VB .NET
First subroutines
If you see something like this
Code:
public void Hello()
{
}
that is a subroutine
just change it to
Code:
Public Sub Hello()
End Sub
variables
if you see something like this
that is how you declare variables. The first word is the data type, and the second is the variable name
so in VB
the C# decalre can also begin with public/private/friend like in VB.
variables are assigned the same way
lala = "hello";
if you see using, that is the same as Imports in VB
if statements are pretty closely the same, just when you see
if(whatever)
{
}
the {} denotes a block if so you would change that to
Code:
If whatever Then
End If
foreach is the same as For Each basically
functions
if you see this
Code:
public string Hello()
{
}
that is a function that returns a string. Pretty easy to guess what that look like in VB.
there are of course some other thigns here and there, but this is enough info to help you scan through C# code to get some needed code for your VB .NET app most of the time
-
Jul 29th, 2002, 07:55 PM
#2
Lively Member
Hmmm... thanks Cander, That was helpfull. I'm having enough trouble with VB.NET, very steep learning curve for me at least.
Do you have any other little tips like that?
-
Jul 30th, 2002, 08:36 AM
#3
I have lots tips I can share. What in particular would like to see some tips on?
-
Jul 30th, 2002, 09:37 PM
#4
Lively Member
Anything really, arrays, is one, i believe there are no control arrays now in VB.NET i use these extensively in my programs and i'm wondering how i'm going to get around them, not sure i understand why they were taken out.
I've gone to your web site and registered on you forum but i haven't had time to look around, i'll try sometime later.
-
Aug 1st, 2002, 07:39 PM
#5
yay gay
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|