hexagon logo

Dmis Skips Printing Commands?

EDIT: THE SOLUTION TO THIS IS ON PAGE 2




I wrote a bit of code based off of information on this message board for printing at the end of a program.

SAVE       =COMMENT/YESNO,NO,Do you want to save this report?
                            ,This will save a PDF of the report
                            ,on the computer.
            IF/SAVE.INPUT=="YES"
            PRINT/REPORT,EXEC MODE=END,$
              TO_FILE=ON,APPEND=FINALFILENAME,$
              TO_PRINTER=OFF,$
              TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
              REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
              PREVIOUS_RUNS=DELETE_INSTANCES
            END_IF/
PRINT      =COMMENT/YESNO,NO,Do you want to print a report?
            IF/PRINT.INPUT=="YES"
            PRINT/REPORT,EXEC MODE=END,$
              TO_FILE=OFF,AUTO=1,$
              TO_PRINTER=ON,$
              TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
              REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
              PREVIOUS_RUNS=DELETE_INSTANCES
            END_IF/


The variable FINALFILENAME is assigned earlier in the code:

WORKORDER  =COMMENT/INPUT,NO,'Enter the workorder #,
                            ,using a period instead of a slash.'
SERIALNUMBER =COMMENT/INPUT,NO,'Enter the Serial # of the piece being inspected.
                              ,If there is no serial number, leave this blank.'
CLOCKNUMBER =COMMENT/INPUT,NO,'Enter your clock #.'
            ASSIGN/PART=STR(GETTEXT(191,1,{FILEHEDR}))
            ASSIGN/DATE=SYSTEMDATE ("MMddyy")
            ASSIGN/TIME=SYSTEMTIME ("HHmm")
            ASSIGN/FILESTORE="C:\PROGRAM FILES\WAI\PC-DMIS V4.3 MR1\PROGRAM FILES\PROGRAM REPORTS\056-000-460-6\ "
            ASSIGN/FILENAME=PART + "_" + WORKORDER.INPUT + "_" + DATE + "_" + TIME + ".PDF"
            ASSIGN/FINALFILENAME=FILESTORE + FILENAME


I have a program that utilizes marked sets to execute different part operations. All of the marked sets go to the print options at the end. The problem is that when you say YES to print PDF, it just skips over it and moves on. Same thing with YES to the print to Printer. When I hold my mouse over the IF statements, it confirms that it "read" the comment answer as Yes, it just chooses not to execute the PRINT/REPORT statements.

I CAN get it to print to PDF and Printer ONCE. For the PDF print, I just modify the name. Change it to SAVE1. Whatever. And it prints to file, for 1 Execution. For the printer print, I change the printer to another printer and then change it back. And it prints 1 time. AngryAngryAngry

Am I screwing this up somehow with how it is using the variables? Or maybe the marked sets? I am totally lost here, because it worked beautiful in my test program I created.
Parents Reply Children
No Data