Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT Z truncates data (bug?)
Message
De
01/09/2005 11:39:17
 
 
À
01/09/2005 10:36:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01045820
Message ID:
01045864
Vues:
28
>To reproduce
>
>
Z=00000000000.00
>CREATE CURSOR tt ( t l )
>APPEND BLANK
>SELECT z from tt INTO CURSOR t
>MODIFY STRUCTURE
>
>observed: Width is 13
>expected: Width must be 14
>applies to Vfp 9, Vfp 7
>
>note: SELECT 00000000000.00 from tt INTO CURSOR t works as expected
>
>I have a lot of SELECT Z ...
>statements in my application and customer scripts.
>
>Please advice how to fix this without re-writing all SELECT statements in aplivcation and forcing all customers to re-write all scripts ?

You want a global change on the z constant, true ?

two ways:
CLEAR
* way 1,you remember that N() is not a fixed format!
Z=0.000

CREATE CURSOR tt ( t l )
APPEND BLANK
* if z=0 then THE LENGHT IS 11+decimals(z) 
SELECT m.z n14 from tt INTO CURSOR t READWRITE
DISPLAY STRUCTURE 
* you can write
REPLACE n14 with -9000000000.09
? n14

* OR

* THIS IS FASTER: 
* PUT THIS INTO THE MASTER #INCLUDE and remove the Z variable
#DEFINE Z 00000000000.00

CREATE CURSOR tt ( t l )
APPEND BLANK
SELECT z from tt INTO CURSOR t READWRITE
DISPLAY STRUCTURE
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform