|
From the discussion we had earlier, it seems like we have the pointeravailable and using the C API to get the length (which I guess finds the
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? Isit
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 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.