PxPlus User Forum

Twitter Twitter Twitter

Author Topic: '*X' mnemonic  (Read 1549 times)

Lawrence_Leavell

  • Silver Member
  • ***
  • Posts: 49
    • View Profile
'*X' mnemonic
« on: August 21, 2019, 04:10:33 PM »
I have a program on the Linux server which creates C:/TEMP/FILENAME.PDF on the workstation.
This works well
OPEN(PRNT)"[wdx]*PDF*;FILE="+REPORT_NAME$+";ORIENTATION="+ORIENTATION$+";Overwrite"

Next, I wish to display this file.
PRINT (PRNT)'*X'="[WDX]SHOW_PDF;"+REPORT_NAME$
====
However, I get an err=49.  What is wrong with this syntax?
===
0010 REM "SHOW_PDF" - Display Client PDF File on Client
0020 REM "lxl/Tesla Systems/20190821
0030 REM
0040 ENTER FILENAME$
0050 IF %WDX$="" THEN MSGBOX "Must be Using Windx to run this program.",OK$; EX
0050:IT
0060 SYSTEM_HELP OPEN WAIT SUB(FILENAME$,"[WDX]","")
0070 EXIT



Mike King

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: '*X' mnemonic
« Reply #1 on: August 21, 2019, 05:03:05 PM »
Lawrence

A few things are wrong;

  • The '*X' should be defined as a mnemonic for the file by using the MNEMONIC directive and not the PRINT directive.
  • When defining a '*X' directive for a WindX based file, the program (SHOW_PDF) must exist on the workstation since thats where the close will actually take place.

BTW: If all you are trying to do is display a PDF file why not just issue:

OPEN (PRINT) "*PDF*;View"

Let PxPlus take care of the rest.  It will create the PDF file, send it to the workstation and invoke whatever PDF viewer the workstation has installed.  When done the PDF file will be deleted however the user can save it using the viewers functions.

If your images are on the workstation or you want to use the fonts that exist on the workstation and not the server then you can just prefix the *PDF* with [LCL] or [WDX].

« Last Edit: August 21, 2019, 05:25:33 PM by Mike King »
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Lawrence_Leavell

  • Silver Member
  • ***
  • Posts: 49
    • View Profile
Re: '*X' mnemonic
« Reply #2 on: August 22, 2019, 06:23:01 PM »
The customer has ordered:
1. Create the output PDF on the PC using a specific name.
2. Display the PDF on the PC PDF Viewer.

What I did was create the PDF on the Linux system and copy it to the PC.
Next, I have tried:
MNEMONIC (CH1)'*R'="SYSTEM_HELP OPEN WAIT "+OUTPUT$
but this does not work, complaining that the file is open.
Is there some other way to do this?

James Zukowski

  • Diamond Member
  • *****
  • Posts: 296
    • View Profile
Re: '*X' mnemonic
« Reply #3 on: August 22, 2019, 06:59:07 PM »
We've got a similar situation, and used this:

Code: [Select]
Options$="FILE=<Filename>.pdf"
Open (Chan,opt=Options$,err=Oops)Wdx$+"*PDF*;View"
.
Print(Chan)...
.
Close(Chan)

As long as you include the ".pdf" in there, it should be fine. Also, since WDX$ is used for opening *PDF*, you don't need it on the filename.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services