Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help on numeric values.
Message
 
 
À
02/05/2001 03:18:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00502357
Message ID:
00502371
Vues:
15
Hi!

1) Number is stored in the memory as a binary value, so it just could not be stored with leading zeros, number here is just a mathematical number. If you want leading zeros, you have to use character value, or convert numbers to characters before displaying/editing and than convert them back when saving.

2) Well, the same as above, number is just a number. Before COPY TO command, you can do a query like following and than 'copy to' the result cursor:
SELECT catalogue, padl(nunmber,5,'0') as number, ... into cursor ...
So you will pre-format certain fields before data export.

3)You can read file into the memory (variable) using FileToStr function. Than do any characters processing you want and save data back to the text file using StrToFile. Works quite quickly if this file is not larger than 1-2MB.

HTH.

>Hi
>
>Can someone please help me with:
>
>1) I need to zero fill numeric values, the PADL() functions seems to work with only character data types.
>
>2) Unload all the fields in a table text delimited with comma delimiters seperating the fields, but the problem is that the fields must be unloaded in the same size than it is defined in the table.
>Example: catalogue (XX12) - char(6) and lot number (453) = numeric, therefore it must be unloaded as "XX12 ",00453,
>I am currently using the "COPY TO" command, but it seems that you cannot unload delimited and in fixed format?
>
>3) Our COBOL program created a flat file which is comma delimited and the text fields are in quotes and the line is ended with a ','. To get the comma I added a dummy field to the table (numeric 1) to get the comma at the end of the flat file. The problem is now that the numeric field unloads a 0 (zero). I do not want a value to be unloaded. How can I get rid of that 0 and replace it example with a .NULL.
>
>Thank you
>
>Irene Grassow
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform