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



Thanks Scott.

I really need to sit down and get the difference between CONST, VALUE and
leaving it blank, sorted in my head.

It doesn't help that I have the c#isum in my head the primitives are passed
by value and object are passed by reference. That clearly doesn't apply in
RPG!!!

To be really honest I was trial and erroring the prototype because of the
receiver too small to receive result problem I was getting, but the 10u 0
for the return field sorted that. I'll go back and revisit the prototype in
the morning and hopefully that will fix it.

All that said the values of iiInpLen and iiOutLen after the call do have the
values i'd expect.

For example on a call converting 1024 bytes of ccsid 285 to ccsid 1200

Before iiInpLen = 1024 and iiOutLen = 1024

After iiInpLen = 512 and iiOutLen = 0

cheers

Neill

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: 03 February 2010 21:42
To: Midrange Systems Technical Discussion
Subject: Re: iconv query

Your iiInpLen and iiOutLen fields should NOT be defined with 'const'.
The API changes those fields to reflect the space left in each of the
buffers as it translates the data.

On 2/3/2010 3:34 PM, Neill Harper wrote:
I have a call to iconv in my program as follows:



D iconvU PR 10U 0 EXTPROC('iconv')
D iaHandle LIKE(ConvHandle) VALUE
D iaInpBuff *
D iiInpLen 10u 0 const
D iaOutBuff *
D iiOutLen 10u 0 const



wrkResult = iconvU(wrkHandle:wrkFrom:wrkFromDataLength:
wrkTo:wrkToDataLength);



When the call happens if there is not enough room in the output buffer
then
the wrkResult has 0xFFFFFFFF in it. (-1)





And errorno is 3491 - Argument list too long.



The thing is the conversion has worked fine up to that point, I would be
expecting E2BIG?



Also I originally had the wrkResult coded as 10i 0, but this was causing
the
dreaded receiver to small to hold result error.



Does anybody have a any idea whats happening here?



Regards



Neill



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.