Looks fine to me!
------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Announcement
Collapse
No announcement yet.
Sending file to printer
Collapse
X
-
From the aforementioned, I get the idea I can use the following:
open "\\laura\epson" for output as #1
open "prntfile.tmp" for input as #2
while not eof(2)
line input #2, a$
print #1, a$
wend
close
Does that look okay?
Regards,
Brian.
------------------
Leave a comment:
-
The slashes need to go the other way, Sven. It would also be better
to use the default command shell. Try this:
Code:SHELL ENVIRON$("COMSPEC") + " /c COPY PRNTFILE.TMP \\LAURA\EPSON"
instead of assuming that it's in the default directory. Windows
doesn't treat default directories in quite the same fashion as DOS.
------------------
Tom Hanlin
PowerBASIC Staff
Leave a comment:
-
COPY is a DOS command.
You can Shell it with "command.com \c copy //blah/blah"
Or just use this:
Code:#COMPILE EXE FUNCTION PBMAIN blah$ = "This is a Test!" OPEN "\\Work-blu101\HP-DJ-970CXI" FOR OUTPUT AS #1 PRINT #1, blah$ CLOSE #1 END FUNCTION
To read your file, use
open "myfile.txt" for binary as #1
get$ #1, lof(1), a$
close #1
'a$ contains your file. Just PRINT it
regards,
Sven
------------------
e-mail: [email protected]
e-mail (work): [email protected]
Leave a comment:
-
"Copy" has been used in DOS programming for many, many moons.
I think you would call it a DOS Utility.
Regards,
Brian.
------------------
Leave a comment:
-
What error are you receiving?
I searched my Win98 machine for "Copy.*" and did not find any file. According to the PB DOCS, SHELL will assume COPY to be an .EXE file since you did not include an extension. Perhaps COPY is either internal to the MS-DOS mode/window or it is a .COM file?
Bernard Ertl
------------------
Leave a comment:
-
Sending file to printer
I am producing A4 size labels with the customer's name and address.
When using DOS, I created a file "prntfile.tmp" with a postscript
header, followed by the various labels in the required list.
To send it to the Postscript Laser Printer on the network, I used
the following:
SHELL "COPY PRNTFILE.TMP \\LAURA\EPSON"
I have rewritten the code using PBDLL, creating the Postscript file
in the same manner as in DOS but using the SHELL statement as above,
the programme produces an error.
What am I doing wrong?
Help would be appreciated.
Regards,
Brian.
------------------
Tags: None
Leave a comment: