|
Hi Tony, > I am attempting to use the Retrieve Journal Entries > (QjoRetrieveJournalEntries) API, and I just can't seem to get the call to > work. Currently, I am just trying to get a small chunk of test code to > work, and learn how to use it further. It compiles, but when I run the > program, I get a CPF24B4 - That's right, a SEVERE error... *grin* I can't > seem to figure out why This API accepts it's parameters by reference. However, you're passing the 2nd-4th parameters by value. That's confusing the API, and it doesn't know what the problem is. > D QJoRtvJE PR > ExtProc('QjoRetrieveJournalEntries') > D RcvVar 4096A > D RcvVarLen 10I 0 Value > D JrnName 20A Value > D FmtName 8A Value > D JrnSelect 1A Options(*Nopass) > D ErrorCode 1A Options(*Nopass) Try changing your prototype so that it looks like this: > D QJoRtvJE PR > ExtProc('QjoRetrieveJournalEntries') > D RcvVar 4096A options(*varsize) > D RcvVarLen 10I 0 const > D JrnName 20A const > D FmtName 8A const > D JrnSelect 8192A const Options(*Nopass:*varsize) > D ErrorCode 8192A Options(*varsize: *nopass) The first thing that you'll see is that I made some of your parameters *VARSIZE. Basically that just allows you to pass a shorter variable than the one that the prototype requires, and helps document the fact that these parms are variable-length. I also changed the VALUE to CONST on the "input" parameters. This allows the compiler to help with converting some data types, while still passing the data by reference. I also added the CONST to the 5th parameter, since that's also input-only. And I increased the size of the last two parameters to values that are hopefully larger than you'll ever need. It's a bit more self-documenting that way, and with the CONST keyword in use, you won't have to worry about the compiler deciding to only pass 1 byte. Anyway, hope that helps...
As an Amazon Associate we earn from qualifying purchases.
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.