Print Command issues

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Print Command issues

    I'm having issues with a print command. Recently wrote a couple scripts that create a couple folders that the reports write to. Works well in test programs, but running it in a customer program, the folder are created, but the print command changes from OVERWRITE to AUTO, and opens up the prompt to save ignoring the assignment with the file path. Any insight would be appreciated.
    Code:
    Code:
     IF/C4.INPUT=="1"
                    ASSIGN/SAVEPATH=""+PATH+"\\"+JOBNUM+"\\"+OP30+"\\"+V1+"_"+V2+"_TOP.pdf"
                  END_IF/
                  IF/C4.INPUT=="2"
                    ASSIGN/SAVEPATH=""+PATH+"\\"+JOBNUM+"\\"+OP50+"\\"+V1+"_"+V2+"_TOP.PDF"
                  END_IF/
                  IF/C4.INPUT=="3"
                    ASSIGN/SAVEPATH=""+PATH+"\\"+JOBNUM+"\\"+OP90+"\\"+V1+"_"+V2+"_TOP.pdf"
                  END_IF/
                  PRINT/REPORT,EXEC MODE=END,$
                    TO_FILE=ON,OVERWRITE=SAVEPATH,AUTO OPEN REPORT=OFF,$
                    TO_PRINTER=OFF,COPIES=1,$
                    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                    TO_EXCEL_OUTPUT=OFF,
                    PREVIOUS_RUNS=DELETE_INSTANCES
    Last edited by Drew_Torg; 09-13-2019, 10:01 AM. Reason: added code

  • #2
    Which version are you using?
    Systems Integrator
    Hexagon Manufacturing Intelligence

    Comment


    • #3
      Cad++ 2014.1

      Comment


      • #4
        is 'SAVEPATH' a network location? Try saving locally, then use file/move to the network address.
        Also having three if/endif's without a default or 'else' command to error proof the input value might be screwing with the path creation.
        try using Select/Case and use default option at end.

        Comment


        • louisd
          louisd commented
          Editing a comment
          make an operator comment that == C4.Input prior to your print command, see what's being produced.
          If C4.input is only going to be an integer: 1, 2, or 3, just put IF/C4.Input==1 --remove the quotes.

      • #5
        Turned out to be an issue with the order I had marked the program up for Marked Sets. All works now, thanks for the help.
        I have logic in the program at a different location to avoid any errors in the path creation, but I'll look into using Select/Case in the future.

        Comment

        Related Topics

        Collapse

        Working...
        X