Right.  You found the problem.  I thought that it was somewhere around the
mapping of types between RPG and C (I noted the requirement for nulls), I
missed the 2 byte to 4 byte issue, and was confused by the @OBJ pointer
type.

I always did this in MI so debugging via email when it is written in ILE C
and using a C function to execute an MI instruction when the data types are
not identical confused me.

Thanks for getting it right!  I learned something.

Richard Jackson
mailto:richardjackson@richardjackson.net
www.richardjacksonltd.com
Voice: 1 (303) 808-8058
Fax:   1 (303) 663-4325

-----Original Message-----
From: owner-mi400@midrange.com [mailto:owner-mi400@midrange.com]On
Behalf Of Simon Coulter
Sent: Wednesday, July 19, 2000 2:21 AM
To: MI400@midrange.com
Subject: Re: Convert an MI program to RPG


M
Hello Richard,

You wrote:
>First, can you change the declare for @OBJ to a system pointer then make
>sure that it is initialized to null before executing rslvsp function?  At
>one time, I did some real damage by not initializing my pointers first.
The
>return value is a system pointer.  The declaration showing in your message
>is for a space pointer.  They are definitely not the same thing.  In the
old
>days, the error messages for MI were pretty bad.

No.  RPG doesn't support SYPs.  See my earlier response for why this works.
I wouldn't
be doing this in RPG because there is no guarantee that the pointer
behaviour I am
exploiting will remain consistent.  This stuff should be done in MI or C.
All I wanted
to prove was that it could be done.

>I suspect that the problem is going to be found somewhere around how RPG
>maps variables and types when it calls a C function.

Actually, in this case the problem is in how Bill is mapping the values due
to not
understanding what is happening at the MI level, nor what is happening in
the C wrapper
function, and not really what is happening in the RPG example.  Hopefully my
earlier
appends will clarify that.  There are only so many ways I can say the same
thing.

Regards,
Simon Coulter.

«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
«» FlyByNight Software         AS/400 Technical Specialists       «»
«» Eclipse the competition - run your business on an IBM AS/400.  «»
«»                                                                «»
«» Phone: +61 3 9419 0175      Mobile: +61 0411 091 400           «»
«» Fax:   +61 3 9419 0175      mailto: shc@flybynight.com.au      «»
«»                                                                «»
«» Windoze should not be open at Warp speed.                      «»
«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
+---
| This is the MI Programmers Mailing List!
| To submit a new message, send your mail to MI400@midrange.com.
| To subscribe to this list send email to MI400-SUB@midrange.com.
| To unsubscribe from this list send email to MI400-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: dr2@cssas400.com
+---

+---
| This is the MI Programmers Mailing List!
| To submit a new message, send your mail to MI400@midrange.com.
| To subscribe to this list send email to MI400-SUB@midrange.com.
| To unsubscribe from this list send email to MI400-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: dr2@cssas400.com
+---

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.