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



My main thing is I want to stay away from any limits and RPG variables. I
just want a pointer and the length.

From the discussion we had earlier, it seems like we have the pointer
available and using the C API to get the length (which I guess finds the
null) we get the length.

It has been years since I've done C as well, so I would love an
explanation. :)

Brad
www.bvstools.com

On Mon, May 23, 2016 at 11:05 AM, John Yeung <gallium.arsenide@xxxxxxxxx>
wrote:

On Mon, May 23, 2016 at 8:42 AM, Bradley Stone <bvstone@xxxxxxxxx> wrote:
So how would a buffer length differ from the data or string length? Is
it
the term "buffer" that is actually incorrect in this case then?

I'm curious about this too. How are you implementing the C strings?

The way Scott was talking about them is familiar to me from my ancient
C days. You (pre-)allocate an array of character (which is the
buffer). As I recall, it was more complicated and inefficient to
dynamically allocate exactly as much memory as you needed; so in
practice you just picked a fixed array size which should be big enough
to handle anything you're likely to encounter. (Very much like SQL or
RPG varying-length strings.)

If your buffer is always the exact length of your data, then it sounds
like either you have a more complicated implementation, or you have an
unsafe implementation, which would be why Scott wants to stick with
his string handling. But it seems like he does agree with you on
returning the current data length.

John Y.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.


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.