Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting size of variable
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00364795
Message ID:
00364802
Vues:
24
>Hi everyone,
>
>Is there a function to determine size of variable? Today I had a numeric overflow Error, so I was thinking, is it possible to find a size (or number of digits) in Numeric variable.
>I finally got it working in this code:
>
>
>if !empty(pnSize) and vartype(pnSize)='N'
>    lnMax=val(replicate('9',pnSize-1))
>     if lnLotSizeSqFt>lnMax
>          lnLotSizeSqFt=lnMax
>     endif
>endif
>there pnSize is a parameter (actual field size). But how can I determine size of variable?

Something like this, if you don't want the decimal portion?

len(alltrim(str(int(nValue))))
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform