Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo box value weirdness when int=8 digits
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Combo box value weirdness when int=8 digits
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01558250
Message ID:
01558250
Vues:
100
A long time ago I got into the habit of never assuming whether a dropdown combobox would return vartype C or N when I was expecting N.

So, when retrieving what I want to be a numeric value I do:

lnValue=val(transform(thisform.cbo.value))

doing it this way, I don't have to test for vartype

I came across a quirk yesterday.

I have a combobox on a form that has a rowsourcetype as 3 - SQL Statement

the SQL statement does select somecharfield,someintfield from sometable into cursor somecursor

BoundTo=.T.
BoundColumn=2
ControlSource=thisform.nValue

When someintfield = 1234567
then
val(transform(thisform.cbo.value))=1234567
val(transform(thisform.nvalue))=1234567

However:
When someintfield=12345678
then
val(transform(thisform.cbo.value))=0
but,
val(transform(thisform.nValue))=12345678

checking into this further
thisform.cbo.value=12345678.0
thisform.nValue=12345678.00

and

transform(thisform.cbo.value)="*******.**"
transform(thisform.nValue)="12345678"

but if I
transform(12345678.0)="12345678"


What. The. Hell.?
Brandon Harker
Sebae Data Solutions
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform