Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Numeric overflow issue
Message
 
À
30/11/2001 12:05:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00588052
Message ID:
00588568
Vues:
31
>>I am trying to do a [replace all] for cField = ***** (Numeric overflow) but I get a error cause ***** has no quotes and isn't a number
>>
>>Yes it is a numeric field and has overflow that looks like ****
>
>Hi, Stephen
>
>... for cField>val(replicate('9',fsize('cField')))
>
>bye

This wont work if the field has decimals, ie N(10,3)
Have to write a function to determine max value to do it with a replace like that.

Something like this should work.
PROCEDURE maxval
LPARAMETERS size, dec
LOCAL cNum
cNum = REPLICATE('9', dec)
cNum = "." + m.cNum
cNum = REPLICATE('9', m.Size - (m.dec + 1)) + m.cNum
RETURN VAL(m.cNum)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform