Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
App created text file - wierd behaviour
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
App created text file - wierd behaviour
Miscellaneous
Thread ID:
00703812
Message ID:
00703812
Views:
48
Within my exe, I am creating a ascii batch file to send to other system. I end each line with a CHR(13) and when I open the file in notepad it looks great. But when I start toggling the wordwrap feature, it gets all screwy. When I first turn word wrap on, it looks the same, but when I turn it off, spreads it all out like it removed the carriage returns. I have posted some of the code and examples of the data in notepad below.


Here is some of the code I use to build the data:
lcdfield1=[48]	
lcmedrec=IIF(liadtfield=1,ALLTRIM(curcompleted.medrecno),ALLT(curcompleted.ssn))
lcdfield2=REPLICATE('0',12-LEN(lcmedrec))+lcmedrec
lcdfield3=SPACE(1)
lccasedate=DTOC(curcompleted.or_date)
lcdfield4=SUBSTR(lccasedate,1,2)+SUBSTR(lccasedate,4,2)+RIGHT(lccasedate,2)
lcchgcode=ALLTRIM(xchgcode.chgcode)
lcdfield5=REPLICATE('0',8-LEN(lcchgcode))+lcchgcode
lcdfield6=SPACE(2)
lcqty=ALLTRIM(STR(xchgdata.qty))
lcdfield7=REPLICATE('0',5-LEN(lcqty))+lcqty
lcdfield8=SPACE(9)
lcdfield9=SPACE(35)
lcdetails=lcdetails+lcdfield1+lcdfield2+lcdfield3+lcdfield4+lcdfield5+ ;
          lcdfield6+lcdfield7+lcdfield8+lcdfield9

** Add Charge Return to the end of the detail line
lcdetails=lcdetails+CHR(13)

* Save Detail Line to lcHeader
=writimm(lcbatchfile,lcdetails)


writimm()
PARAMETER lcFile,lcString
local lnHandle
IF FILE(lcFile)
	lnHandle = FOPEN(lcFile, 2)
ELSE
	lnHandle = FCREATE(lcFile, 0)
ENDIF
= FSEEK(lnHandle, 0, 2)
lnReturn = FPUTS(lnHandle, lcString)
=FCLOSE(lnHandle)
This is a snippit of the file when I first open it in notepad, although when I open it in notepad it does not appear double spaced, only when I paste it in here:
D    03    TY04B0KM091902    CQIOR  CQI011

48021005365784 09190254141452  00001                                            

48021005365784 09190254142450  00001                                            

48021005365784 09190281940454  00001                                            

48021005365784 09190281942203  00001                                            

48021005365784 09190281942203  00001                                            

48021005365784 09190281420762  00001                                            

48021005365784 09190281942203  00002                                            

48021005365784 09190281650004  00001                                            

48021005365784 09190237030202  00001                                            

48021005365784 09190237030269  00030                                            

48021005365784 09190232100026  00001                                            

48021005365784 09190232100059  00030                                            

48021005379777 09190281650707  00001                                            

48021005379777 09190281621401  00001                                            

48021005379777 09190232101008  00001                                            

48021005379777 09190237030202  00001                                            

48021005379777 09190237030269  00002                                            

48021005376526 09190281723306  00001                                            

48021005376526 09190281750606  00001                                            

48021005376526 09190281650509  00001                                            

48021005376526 09190281760704  00001                                            

48021005376526 09190253311569  00001                                            

48021005376526 09190237030202  00001                                            

<PRE>

And here is what it looks like after I toggle the word wrap on and off, except that in notepad it spread it out across the screen and nothing lines up.
<PRE>
D    03    TY04B0KM091902    CQIOR  CQI01148021005365784 09190254141452  00001                                            48021005365784 09190254142450  00001                                            48021005365784 09190281940454  00001                                            48021005365784 09190281942203  00001                                            48021005365784 09190281942203  00001                                            48021005365784 09190281420762  00001                                            48021005365784 09190281942203  00002                                            48021005365784 09190281650004  00001                                            48021005365784 09190237030202  00001                                            48021005365784 09190237030269  00030                                            48021005365784 09190232100026  00001                                            48021005365784 09190232100059  00030                                            48021005379777 09190281650707  00001                                            48021005379777 09190281621401  00001                                            48021005379777 09190232101008  00001                                            48021005379777 09190237030202  00001                                            48021005379777 09190237030269  00002                                            48021005376526 09190281723306  00001                                            48021005376526 09190281750606  00001                                            48021005376526 09190281650509  00001                                            48021005376526 09190281760704  00001                                            48021005376526 09190253311569  00001                                            48021005376526 09190237030202  00001                                            48021005376526 09190235001007  00001                                            48021005371139 09190281620957  00001                                            48021005371139 09190281944332  00001                                            48021005371139 09190254140801  00002                                            48021005371139 09190280341050  00001                                            48021005371139 09190281776908  00001                                            48021005371139 09190280352321  00001                                            48021005371139 09190280240559  00001                                            48021005371139 09190281650152  00001                                            48021005371139 09190281753105  00001                                            48021005371139 09190237000023  00001                                            48021005371139 09190237000056  00013                                            48021005371139 09190235001007  00001                                            48021005371139 09190235001023  00013                                            48021005377094 09190281723306  00001                                            48021005377094 09190281750606  00001
Any explanations helpful.
Kirk
Next
Reply
Map
View

Click here to load this message in the networking platform