×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
On Sun, 7 Apr 2013, at 05:09:20, steff Sucala <sucala76@xxxxxxxxx> wrote:
I'm reading a line from an IBM created journal and I want to display the name of the file that was accessed.?
I'm using this API, and getting the results I want when everything is ok.?
If you check the manual you'll see it says:
Return Value
...
NULL
Qp0lGetPathFromFileID() was not successful. The errno global variable is set to indicate the error. After an error, the contents ofbuf are not defined.
Not that it helps you a lot if you don't know how to get errno in an RPG program ...
This will show you how to get errno and the second example shows how to get the error string if you need it.
// Prototype for __errno() - Retrieve C error number
D GetErrno Pr * Extproc('__errno')
// errno is BASED on pointer returned by __errno()
D errno S 10i 0 Based(pErrno)
/Free
pErrno = GetErrno();
// The actual error number is now available in errno
// Prototype for strerror() - Retrieve error text for given errno
D StrError Pr * ExtProc('strerror')
D errno 10i 0 Value
// Variables for strerror() API
D pErrorTxt S *
D message S 52a
/Free
pErrorTxt = StrError(errno);
message = 'Error code: ' + %char(ErrorNo) + ': '
+ %Str(pErrorTxt);
dsply message;
Hope this helps.
Jon Paris
www.partner400.com
www.SystemiDeveloper.com
As an Amazon Associate we earn from qualifying purchases.