Hi Vern,

I suspect the first parameter is an integer but I don't know for sure -
it's called a conversion descriptor and in the docs has a data type of
iconv_t, so I'd have to go to the QSYSINC/H source file to find what
that is.

in RPG the first parameter should look like this (for those of you who are too lazy to search for examples)

d iconv_t DS qualified
d based(Template)
d return_value 10I 0
d cd 10I 0 dim(12)


Well, it turns out to be a struct - comprising 1 integer and an array of
12 integers. This has to be by VALUE, because C-structs are passed that way.

It's true that this API expects the structure to be passed by value. However, it's *not* because "C-structs are passed that way". The vast majority of structures I've seen used in C are passed by reference.

This one just /happens/ to be passed by value.

Just do what the API is expecting. No need for trial and error, or doing things wrong just because you have some preconceived notion of how it should work. Just do what it wants you to do. It'll save you years of headaches.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.