Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with FSIZE()
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00393504
Message ID:
00393536
Vues:
16
If the other suggestions don't work, you can always use this little UDF I just wrote for you. It's quick and dirty, so I don't know how efficient, but it may give you an idea.

Michelle

---
PARAMETER lnNum
lcNum = ALLT(STR(lnNum,20,10))

llInDec = .F.
lnTotDig = 0

FOR i = 1 TO LEN(lcNum)
   lcDig = SUBSTR(lcNum,i,1)
   llInDec = llInDec OR (lcDig = ".")
   IF (NOT llInDec) OR (VAL(lcDig) > 0) OR (lcDig = ".")
      lnTotDig = lnTotDig + 1
   ENDIF
ENDFOR

RETURN lnTotDig
---



>Yes this works. But now I remember why I did not use this: I loose the decimals in this case. Some fields have decimals (normally two), others not. How can I determine whether a field has decimals? When I know this, I can use STR(fieldname,NrOfDecimals) and the problem is solved.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform