Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert character into integer?
Message
De
25/01/2007 12:08:38
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01189249
Message ID:
01189275
Vues:
27
Just curious, Sergey do you know why CAST works where VAL does not? Specifically a string with "2E" in it? I understand why VFP sees it as scientific notation, but CAST does not...
lcvalue = "2E828"
lcvalue1 = "200"
? VAL(lcvalue)  && produces numeric overflow
? CAST(lcvalue as Int)  && returns 0
? VAL(lcvalue1)   && returns 200
? CAST(lcvalue1 as Int)  && returns 200
tclocation = "2E818 Main St"
? CAST(GETWORDNUM(tclocation,1) AS INT)
tclocation = "2010 N Main St"
? CAST(GETWORDNUM(tclocation,1) AS INT)
>>How do I convert character into integer? Please help. Thanks, Sam
>
>
>lcString = "12345"
>? CAST(lcString AS int)
>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform