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:
00393532
Vues:
18
>>
>>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform