Page 1 of 1

[RPG]LRNG_Checkproperty

Posted: Tue Mar 29, 2016 8:55 pm
by MegumiSawada
Hi,

I would like to show PDF on webview element on a formview and would like to check if the target PDF exist or not before showing it.
However, it seems LRNG_CheckProperty doesn't accept URL like 'http://ext.lansa.jp/temp/sawada.pdf'.

Is there any way to achieve my requirement?

FYI:
[RPG](extracted)
D PDF_RESOURCE C 'http://ext.lansa.jp/temp/sawada.pdf'
If LRNG_CheckProperty(PDF_RESOURCE);
IsNewForm = False;
Endif;

[Error message when executing]
---------------------------------------------------------------
Error Code = 0. Character ':' is not allowed in property names.
Allowed in property names. Allowed characters are alphanumric and
underscore '_'.
Property name is not valid: 'HTTP'.
---------------------------------------------------------------

Best Regards,
Megumi Sawada

Re: [RPG]LRNG_Checkproperty

Posted: Wed Mar 30, 2016 8:44 am
by MarkDuignan
In the LRNGCOMMON include member are a number of IFS file manipulation functions. I think this one might be the useful here:

Code: Select all

     DLRNG_FileExists  pr            10I 0 extproc('LRNG_fexists')
     D FileName                        *   value options(*String)

     CheckFileName = ‘/MyFolderonIFS/Subfolder1/MyFile.pdf’; 

     If ( LRNG_FileExists(CheckFileName) = 1  ); 
        // The file exists 
     Endif;

Re: [RPG]LRNG_Checkproperty

Posted: Thu Mar 31, 2016 11:35 am
by MegumiSawada
Hi Mark,

Thank you for your advice.

I think this LRNG_FileExists can check only on IFS(as same as LRNG_CheckProperty).
The PDF file is on the external web server. I would like to check if it exists before showing on a formview.
Do I need to assign this external web server to IFS directory?
Or is it not possible to check if the file exist on the external web server?

Best Regards,
Megumi

Re: [RPG]LRNG_Checkproperty

Posted: Thu Mar 31, 2016 11:58 am
by MarkDuignan
Yes, to make LRNG_FileExists work you would need to configure QNTC so that your IBM i based RPG program could access the network folder containing the PDF files on the web server. I have never done that but it seems in theory that would work.

http://www-01.ibm.com/support/docview.w ... s8N1021028

Re: [RPG]LRNG_Checkproperty

Posted: Thu Mar 31, 2016 12:25 pm
by MegumiSawada
Hi Mark,

I See. I'll try.
Thank you for your advice!

Best Regards,
Megumi