Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's up with the PADL?
Message
De
11/10/2005 01:38:27
 
 
À
11/10/2005 01:32:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01057840
Message ID:
01057849
Vues:
9
>>Hmm, interesting. I didn't know you could use PADL() with a general expression, I thought it had to be a string.
>
>tnNumero comes from an object property This.nNumero which is initialize from a cursor field which comes from a table on an integer field. So, if I select a field in a cursor that is an integer, store that in a property, I should end up with the proper value.

Doesn't matter. The minute you have PARAMETER/LPARAMETER tnNumero, you've done an implicit conversion to numeric, not integer. In fact, it probably happened on storing it to the object property - I don't believe object properties can be integers, either.

>
>IAC, as I said, I have this at various other levels as well. I have experienced this with VFP 9. Basically, I read a HTML form value with WWC object, such as Request.Form, and sometimes, I end up as well with that behavior when getting the VAL() value of what Request.Form returns. It simply just doesn't make any sense. I have started to put INT() mostly everywhere I am using PADL() now.

Like I said, you'll need to include ROUND() for it to be bulletproof. The joys of decimal/floating point approximations of integers ...
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