Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with FSIZE()
Message
From
17/07/2000 16:58:38
 
 
To
17/07/2000 16:43:36
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00393504
Message ID:
00393536
Views:
19
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform