dc_printfile problem and workaround

This forum is for eXpress++ general support.
Post Reply
Message
Author
BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

dc_printfile problem and workaround

#1 Post by BruceN »

Due to a significant number of customers having print spooler crashes with dc_printfile, I've had to go to the DCPRINT ON function.

I have my report writing to a text file (report.txt) and then I'm loading that into an array via DELDBE singlefield. and printing the array a line at a time, with an DCPRINT EJECT inserted whenever the line contains '[ Continued ]'.

I'm running into some issues with that method when quotes and commas are in the data. Is there a better way of printing the file?

Perhaps a better way to load the report.txt file into an array than treating it as a single record ascii data file?

thanks,

bruce
There are only 10 kinds of people - those who understand binary and those who don't :)

bwolfsohn
Posts: 649
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: dc_printfile problem and workaround

#2 Post by bwolfsohn »

Bruce,

Here's another way..

local cText:=memoread('report.txt')
local nLines:=mlcount(alltrim(cText))
FOR i:= 1 TO nLines
if !empty(cLine:=memoline(cText,1024,i))
// print your line here
// or aadd it into an array
endif
NEXT
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: dc_printfile problem and workaround

#3 Post by BruceN »

THANK YOU... that worked perfectly! Although to be honest I expected no less from you wizards :)

I had thought about using memoread, but was unaware off the mlcounrt and memoline functions and couldn't figure out how to break them out.

bruce
There are only 10 kinds of people - those who understand binary and those who don't :)

Post Reply