Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy File Type SDF and Change Field Lengths?
Message
De
06/12/2005 10:01:01
 
 
À
05/12/2005 17:34:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01075080
Message ID:
01075301
Vues:
16
Yes, you are right. The below works:
CLOSE all
USE reinreq
m.m_filename = "TestSDF.txt"
set FILTER TO EMPTY(DATE_SENT) .AND. !DELETED()
LOCATE
IF FOUND()
   SET FIELDS GLOBAL
   SET FIELDS TO AGENT_CODE, AGENT_CSR, ACCOUNT=CAST(ACCOUNT AS C(9)), NAME,;
	POLICY=CAST(POLICY AS C(14)), CO_CONTACT, AMOUNTPAID, FAX_MAIL,;
	COMMENTS, REC_DATE, REC_NUM, REC_TYPE,;
	DATE_ENTER
   COPY TO (m.m_filename) TYPE SDF
   SET FIELDS TO
   MODIFY FILE (m.m_filename)
ENDIF
>>I tried that myself Fabio to no avail. It drops the two fields that use CAST() completely. No error, but the resultant file is missing those two fields.
>>
>>
>This works for me
>
>CREATE CURSOR REINREQ (AGENT_CODE N(6),ACCOUNT N(20),POLICY C(25))
>APPEND BLANK
>REPLACE ACCOUNT  WITH 999999999999999
>REPLACE POLICY WITH REPLICATE('D',25)
>LOCATE
>IF FOUND()
>	SET FIELDS GLOBAL
>	SET FIELDS TO AGENT_CODE, ACCOUNT=CAST(ACCOUNT AS C(9));
>,		POLICY=CAST(POLICY AS C(14))
>	BROWSE
>	COPY TO SDFFILE TYPE SDF
>	SET FIELDS TO
>	MODIFY FILE SDFFILE.TXT
>ENDIF
>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform