hexagon logo

PRS_SaveDoc / Adding PRC to SDB

Hello.

I am running Q7, one version last updated 2011, the other in 2017. The newer version has the PRS_SaveDoc command, which I find is the best way to output PDF and the standard command I want to use on both CMMs. I am trying to "install" the PRS_SaveDoc command to the older Q7. I am opening the SDB in newer version, viewing PRS_SaveDoc in the info box tab and copying the contents to a txt file, then copying the contents of the txt file to the command buffer in the old Q7. I am believing if I execute this, it should create the PRC in the SDB so I can use the command. However It hangs up on a CVSTRREA line, see code and grab of error.

!-------------------------------------------------------------------------
! PRC:PRS_SaveDoc
! modified PRC:PRS_SavePDF for creating PDF/XPS without PDFCreator
! 30.Jan.2014 (NR)
! 24.Apr.2014 (JO) remove BOO:
! 25.Apr.2014 (HJS) use different error message
! 29.Apr.2014 (HJS) adjust behavoir of PRC to Printer Server (file extension)
!                   in case of TMO > 0
!-------------------------------------------------------------------------

ENBSYS          (NAM=CLEANUP)

~DIR$$ = ~INP$CHS(1)
~FIL$$ = ~INP$CHS(2)
~FMT$$ = ~INP$CHS(3)
~PGN$$ = ~INP$CHS(4)
~OPN$$ = ~INP$CHS(5)
~NAM$$ = ~INP$CHS(6)
~TMO$$ = ~INP$CHS(7)
[COLOR=#FF0000]CVSTRREA        (NAM=TMO$$, STR=~TMO$$, NBR=1)[/COLOR]
TESTQUE         (REA=Fnd$$, OBJ=CHS:~INP$CHS(8))
IFTHEN          (VL1=Fnd$$, VL2=0, TYP=GT)
  ~CLS$$ = ~INP$CHS(8)
 ELSE
  ~CLS$$ = S
ENDIF




Is this even a legitimate way to copy a PRC over?

If so, any idea why this hangs up here?

Thanks
  • Don't try to run the code directly from the command buffer, you need to create the procedure and the associated dialogue page. The list of character string variables (~DIR$$, ~FIL$$ etc) are inputs related to the dialog page and because you don't have that dialog page or inputs it is hanging up.

    In the command buffer type EDTPRC and enter the name of the procedure as shown below ( make sure you include the LDBPRC: )

    EDTPRC          (NAM=LDBPRC:PRS_SaveDoc)


    This will open a blank command buffer into which you can paste the code from your text file before clicking the save and exit icon on the tool bar (bottom left of screen). You will also need to copy over SDBSYM:
    PRS_SaveDoc and SDBDLP:PRS_SaveDoc.

    Once you are happy that everything has copied across and is working on the older system, copy your LDB objects into the GDB so that they will be available for all wdb's. You will need to exit and re-start QUINDOS to permanently update the GDB.

    An easier way may be to simply copy all of the PRS_SaveDoc objects from the SDB to the LDB on the newer version of QUINDOS, save the wdb, and then load that wdb into the old version of QUINDOS. You can then copy the PRS_SaveDoc objects from the LDB to the GDB before closing and re-opening QUINDOS.
  • Thanks Neil.

    On the money as usual.

    I went for the easier option which worked perfect. Can you tell me, what exactly the SYM object type is for?

    Cheers.
  • The SYM object (symbol) is basically how it links the QUINDOS command PRS_SaveDoc to the PRS_SaveDoc procedure. Without the SYM you would have to INDPRC to run the PRS_SaveDoc procedure.
  • I might have jumped the gun on this a bit. I got the PRS_SaveDoc command into our older Q7, however it does not seem to work, below is the standard code used before the command.
    PLS_AddPagesToReport
    ~PART_NUM = 801_7022_ISSB_#
    ~DATE=_DATE
    LISCHS          (NAM=~DATE, DEV=D1)
    ~TIME=_TIME
    LISCHS          (NAM=~TIME, DEV=D1)
    CONCAT          (NAM=~RPRT, STR=(~PART_NUM,~S_N,"___ON_",~DATE,"_AT_",~TIME), INI=Y)
    WAIT            (SEC=5)
    !PRS_SavePDF     (DIR=C:\REPORTS\, FIL=~RPRT)
    PRS_SaveDoc     (DIR=C:\REPORTS\, FIL=~RPRT)


    This works fine on the newer version of Q7. There is no error message either. Any ideas?