× 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.



Thank you Jon

Exactly what I needed.
Works great.

Thanks

Sent from my iPad

On 7 באפר 2013, at 20:33, Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:


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




--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.