Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can't get VFP's ASC() equivalent
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00672119
Message ID:
00672127
Vues:
28
You need to convert the string into a Char then cast it to Int. Try this instead:

(int)Char.Parse(cString.Substring( 1, 1 ));

>In VFP I can do this:
>
>lnChar = asc( substring( cString, 1, 1 ) )
>
>
>I can't figure out how to do it in c#. I've tried
>
>int lnChar = (int)cString.Substring( 1, 1 )
>
>but I get an error 'Cannot convert type string to int'. Apparently, it must be type 'char' in order to cast it as an 'int'. The only problem is, 'Cannot convert type string to char' either. Anybody know what I need to do here? Thanks a lot,
>jfh
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform