Pdisk Vs SETPTR (AREV Specific)
At 06 JAN 1999 09:30:54PM Mark Ford wrote:
Using AREV 3.2 I wish to send a report to a print file and check if the file exists before writing it.
Using Pdisk and the SETPTR function I can write the file successfully but the system always reports that a new file exists when in fact it does not.
When is the difference between Pdisk and SETPTR?
Any help will be greatly appreciated.
Thanks, Mark
At 06 JAN 1999 09:49PM Matt Sorrell wrote:
Mark,
I'm not sure what the difference between pdisk and setptr are, but if you just want to verify the existence before trying to print the doc, you could do the following in an R/BASIC program:
FILENAME=MYFILE.TXT"
PERFORM "PDISK ":FILENAME
/*
RUN YOUR REPORT HERE*/
OSOPEN FILENAME TO DOS.FILE THEN
PC EXIT ERASE *.SUS
PERFORM "SUSPEND EXIT COPY ":FILENAME:" LPT1"
END ELSE
MSG("HEY, THERE'S NO FILE!!!%B%")
END
STOP
That should do the trick. If you have any questions, feel free to ask.
Matt Sorrell
At 07 JAN 1999 05:24PM [email protected] - [url=http://www.sprezzatura.com]Sprezzatura, Inc.[/url] wrote:
Don't know the exact error you are getting, but PDISK is just a shell around SETPTR. SETPTR does all the work and is what reports back the existance of the file or not.
At 08 JAN 1999 07:48PM ed wrote:
Iw as told once that the documentation for using SETPTR was incomplete and some varibales may not be set correctly when called directly from Rbasic. Using PDISK however, sets everything correctly. Is this true?
At 09 JAN 1999 11:16AM [email protected] - [url=http://www.sprezzatura.com]Sprezzatura, Inc.[/url] wrote:
PDISK might return better error codes or something, but all it does is call SETPTR.
@PDISK.ON might be set as well. Can't think of where else it would be.
At 13 JAN 1999 01:48AM Charles Schmidling wrote:
Simply…
SETPTR is the assembler routine that re-routes printer vectors to a print file or other device rather than PRN. It will check for file existence and return a code for it as well as allow you to send a code at it to overwrite. It can also be used to re-route output to any valid device (e.g. COM2 or NUL) but will always find an existing file.
PDISK is a RBASIC utility that uses SETPTR to print stuff to a printer. If you had the commands, you could do it yourself. PDISK is available in source on the REVG2b utility disk.
I don't think SETPTR has been re-written to accomodate the changes in operating systems and networks. Hence the problem of not being able to PDISK to a network device and back again. I suspect there are a few more device parameters in a Win95 printer control block than was around in 1986 or so, when SETPTR was written.
Anybody want to fix it? I'm sure it would be greatly appreciated.
Charles Schmidling
DATASCAN Systems, Inc.