×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Hans,

Last eMail forget it. It has been sent by error.

I'll try your solution mentioned below.

Thanks for your request.

Rgds.

Jordi.







JCarreras@xxxxxxxxxx wrote:
> Hi,
>
> Does someone know how I can insert string data into pointer's field with
> ILE RPG language?
>
> I need to insert an string data into Pointer field, so I should change
> size's field, but I don't knows how do it.

Questions like this are best asked in the RPG400-L mailing list.

But to get to your question, I'm not really sure what you're asking,
so I might not have the answer you're looking for. Clearly, you
can't put string data into a pointer variable. So I assume you have
a pointer to some string data and you want to insert into that area.

*If* you know the full extent of the particular storage pointed at
by the pointer, you can define a BASED character variable based on
that pointer, and then you can manipulate that BASED variable. You
can use the %REPLACE built-in function to insert text into some
string by specifying 0 as the 4th argument.

That is, if you know your pointer points at an area of, say, 100 bytes:

D bstr        s              100a   based(ptr)
  /free
      bstr = %replace('char to insert':bstr:startpos:0);
  /end-free

But I'm not sure if that really does what you want. If not, please
provide more detail of what you're trying to do and follow up on
RPG400-L.

Cheers! Hans


_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.





As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2026 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.