|
Home > Archive > dBASE Questions and Answers > September 2005 > Howto print a simple text file with dBPlus
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Howto print a simple text file with dBPlus
|
|
| André CATEL 2005-09-26, 7:23 am |
| I have an app which creates some text files and I woul like to send this file to a Windows generic TEXT spooler within dBase.
I can not use TYPE command as this add a blank line at the beginning and this freeze the printer.
I dont need to use any dBase reports, I just want to send the file to the Windows spool. I did have a look to the file class, but does not contain any print() method.
How can I do that ?
Thanks in advance.
André
| |
| Fred van der Meulen 2005-09-28, 8:24 pm |
| Hello André,
"André CATEL" <andre.catel@carrier.utc.com> schreef in bericht
news:1JvbnZnwFHA.1304@news-server...
>I have an app which creates some text files and I woul like to send this
>file to a Windows generic TEXT spooler within dBase.
>
> I can not use TYPE command as this add a blank line at the beginning and
> this freeze the printer.
>
> I dont need to use any dBase reports, I just want to send the file to the
> Windows spool. I did have a look to the file class, but does not contain
> any print() method.
Try the following code:
********************
**
set printer to
set printer on
fIn = new File()
fIn.open("yourfile.txt")
do while not fIn.eof()
cString = fIn.gets()
? cString
enddo
fIn.close()
set printer to
set printer off
********************
**
Regards,
Fred.
| |
| André CATEL 2005-09-29, 8:24 pm |
|
Thanks,
André
Fred van der Meulen Wrote:
> Hello André,
>
> "André CATEL" <andre.catel@carrier.utc.com> schreef in bericht
> news:1JvbnZnwFHA.1304@news-server...
>
> Try the following code:
>
> ********************
**
> set printer to
> set printer on
> fIn = new File()
> fIn.open("yourfile.txt")
> do while not fIn.eof()
> cString = fIn.gets()
> ? cString
> enddo
> fIn.close()
> set printer to
> set printer off
> ********************
**
>
> Regards,
> Fred.
>
>
>
>
>
>
>
>
| |
| Robert Bravery 2005-09-30, 3:23 am |
| HI,
Try
run(true, "wordpad.exe /pt 'mytextfile.txt' 'myprinter name'")
Make sure you put in the correct path to wordpad, and give the correct
printer name and text file.
There will be a slight flicker, havent been able to work around tht yet.
Robert
"André CATEL" <andre.catel@carrier.utc.com> wrote in message
news:1JvbnZnwFHA.1304@news-server...
> I have an app which creates some text files and I woul like to send this
file to a Windows generic TEXT spooler within dBase.
>
> I can not use TYPE command as this add a blank line at the beginning and
this freeze the printer.
>
> I dont need to use any dBase reports, I just want to send the file to the
Windows spool. I did have a look to the file class, but does not contain any
print() method.
>
> How can I do that ?
>
> Thanks in advance.
> André
|
|
|
|
|