Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with FSIZE()
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00393504
Message ID:
00393532
Views:
17
>>
>>You will get 4 with an Integer type field because an integer is store as a 4-byte binary value. If you want the number of digits stored in a integer type field you might try Len(AllTrim(Str(fieldname))). This will get the number of digits.
>>
>>Hope this helps.
>
>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.

An Integer Type field will never have decimals. If you are not sure if the field you want the length of has decimals or not you will need to do an AFIELDS() to get the field names and information into an array. Column 3 will give you the length and column 4 will give you the decimal places. Note that currency is always stored with 4 decimal places.
Previous
Reply
Map
View

Click here to load this message in the networking platform