Discussion:
Some help with RUNCODE
(too old to reply)
c***@gmail.com
2020-04-07 12:47:42 UTC
Permalink
Hi All,

The following code (to start Adobe Reader) works fine but, I'm having a problem with RUNCODE.

clear(loc:filename)
set(master)
Access:Master.Next
set(pdffiles)
loop until eof(pdffiles)
access:pdffiles.Next
if PDF:sel=1
loc:filename=clip(Mas:PDFFolder)&'\'&format(PDF:PDFNo,@n08)&'.PDF'
display !so I can see what is going on..
run(loc:filename,true) !works fine..
if RUNCODE() = 0
PDF:sel=0
PDF:Must=0
PDF:Printed=1
PDF:NoOfTimes+=1
access:pdffiles.update
END
END
END
ThisWindow.Reset(1)

Note that I am NOT calling the EXE but, instead I am using the system File Associations to start reader.

A few tips, or a little help would be appreciated.

TIA
Sean H
2020-04-10 03:40:11 UTC
Permalink
RunCode is set by the called program.
So if Adobe doesn't set the runcode, there's nothing to read.

You don't say what your problem actually is


Sean H
Post by c***@gmail.com
Hi All,
The following code (to start Adobe Reader) works fine but, I'm having a problem with RUNCODE.
clear(loc:filename)
set(master)
Access:Master.Next
set(pdffiles)
loop until eof(pdffiles)
access:pdffiles.Next
if PDF:sel=1
display !so I can see what is going on..
run(loc:filename,true) !works fine..
if RUNCODE() = 0
PDF:sel=0
PDF:Must=0
PDF:Printed=1
PDF:NoOfTimes+=1
access:pdffiles.update
END
END
END
ThisWindow.Reset(1)
Note that I am NOT calling the EXE but, instead I am using the system File Associations to start reader.
A few tips, or a little help would be appreciated.
TIA
c***@gmail.com
2020-04-10 07:16:34 UTC
Permalink
Hi Sean,

The problem is that I have users who abort printing from Adobe Reader for documents that MUST be printed for audit purposes.

I am attempting to read an exit code, from Adobe Reader, that will tell me if the document was actually printed or did the user simply preview it and press the close [X] button.

The document names are stored in a file (PDFFILES) and have a flag attached indicating whether the must be printed, or not.

A succesful print (RUNCODE = 0, perhaps?) should clear the MUST flag, therefore allowing other operations (eg;delete) to proceed.

I guess that the biggest problem I have is that I have been unable to find a list of Adobe Reader exit codes. Plenty for the install routines etc., but none for normal operations.
Sean H
2020-04-10 12:18:22 UTC
Permalink
Post by c***@gmail.com
Hi Sean,
The problem is that I have users who abort printing from Adobe Reader for documents that MUST be printed for audit purposes.
I am attempting to read an exit code, from Adobe Reader, that will tell me if the document was actually printed or did the user simply preview it and press the close [X] button.
The document names are stored in a file (PDFFILES) and have a flag attached indicating whether the must be printed, or not.
A succesful print (RUNCODE = 0, perhaps?) should clear the MUST flag, therefore allowing other operations (eg;delete) to proceed.
I guess that the biggest problem I have is that I have been unable to find a list of Adobe Reader exit codes. Plenty for the install routines etc., but none for normal operations.
I don't know if Reader even sets a code. Runcode can be considered
obsolete these days. You really need to look at their docs.

There are other PDF Clarion solutions around. Admittedly they cost, but
Perhaps one of them might be a better fit considering the importance.

you might also ask on Clarionhub.com or the SV newsgroups at
news.softvelocity.com where way more people hang out


Sean H
Leonid Chudakov
2020-04-11 16:10:46 UTC
Permalink
Hi,

If you need full control over printing PDF files check QuickPDF Library
http://klarisoft.com/KSNews_160.htm
or WPViewPDF
http://klarisoft.com/KSNews_150.htm

Leonid Chudakov
Post by c***@gmail.com
Hi All,
The following code (to start Adobe Reader) works fine but, I'm having a problem with RUNCODE.
clear(loc:filename)
set(master)
Access:Master.Next
set(pdffiles)
loop until eof(pdffiles)
access:pdffiles.Next
if PDF:sel=1
display !so I can see what is going on..
run(loc:filename,true) !works fine..
if RUNCODE() = 0
PDF:sel=0
PDF:Must=0
PDF:Printed=1
PDF:NoOfTimes+=1
access:pdffiles.update
END
END
END
ThisWindow.Reset(1)
Note that I am NOT calling the EXE but, instead I am using the system File Associations to start reader.
A few tips, or a little help would be appreciated.
TIA
c***@gmail.com
2020-04-11 17:28:29 UTC
Permalink
Thanks Leonid,

I will take a look

Loading...