VB to C++

closed account (zwpL3TCk)
Hi! Is it possible to convert VB 6.0 Commands (Operator, Statements) to C++?
I don't think there is a tool to convert whole programs, but if you know both languages you can do it by hand. Note that the changes you have to make might be more than just syntactical.
closed account (zwpL3TCk)
Can you give me a simple snippet of code in vb 6.0 to translate the statement

1
2
3
4
If condition Then
Statements
Else
End If


to
1
2
3
4
5
6
7
8
If (condition)
{
statement
}
else
{
statement
}
If you want VB code, you probably should be posting on a VB site.

Your syntax in the second snippet is fine, except for the following:
line 1: if should not be capitalized. C++ is case sensitive.
lines 3,7: statement(s) must be terminated with a ;

If I understand your question correctly, you are looking for an automated way to convert VB to C++. To do that, you really need to write a parser capable of parsing the VB language and then generate the corresponding C++ syntax. That's not a trivial undertaking.

Topic archived. No new replies allowed.