Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to determine the field a textbox is bound to
Message
De
01/11/2010 04:16:43
 
 
À
01/11/2010 03:43:53
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 8.0
OS:
Vista
Network:
Windows XP
Database:
Jet/Access Engine
Application:
Desktop
Divers
Thread ID:
01487443
Message ID:
01487739
Vues:
38
>>>>>BTW what's your 'favorite online C#-to-VB converter' ?
>>>>
>>>>I have two of them that I like:
>>>>
>>>>http://www.carlosag.net/Tools/CodeTranslator/ - translates in both directions
>>>>http://authors.aspalliance.com/aldotnet/examples/translate.aspx - C#-to-VB only
>>>.
>>>Thx. Never looked for anything like that before. I have no trouble translated VB -> C# - it's only the reverse that give me pause.
>>>Both were interesting. Both tripped up on:
int i =25;
>>>int i2 = i < 25 ? 1 : 0;
(g)

>>
>>Yeah, in the past I've seen one or the other give wrong results, but for the most part they're pretty good. The first converter really messed up your example code, but the second converter was close enough so that you'd at least know what the C# code meant (if you were a VB developer and didn't know C# at all)
>>
>>
>>Dim i2 As Integer = (If i < 25 Then 1 Else 0) 
>>'ToDo: Unsupported feature: conditional (?) operator.
>>
>>
>
>Duh. The second result is actually spot on. I think I must have just mis-typed the C# code that I submitted for that one :-{
>I was just wondereing, purely out of curiousity, how I'd go about writing a similar translartor.....

I understand there are some decompilers for .Net, so one brute-force approach would be to compile CodeInLang1, and use a decompiler and specify OutputInLang2.

Whether you write a translator or use the approach above, I'm thinking a basic sanity check would be to compile CodeInLang1 and CodeInLang2 and see if the results are identical.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform