Fixed-Length strings vs. NUL-terminated strings

Patrik Schindler <[email protected]> Fri, 4 Jun 2021 14:01:50 +0200
Newsgroups gmane.comp.lang.as400.c
Message-ID <[email protected]>
Hello,

reading from a database table (declared with fixed length strings for easier handling in RPG for green screen use) with the _R API calls returns fixed length strings, filled with spaces until the space is exhausted.

Do I need to come up with a hand crafted function to "convert" these to C-style strings, or does IBM i provide an API for achieving this? By "conversion" I want to point out that I don't care if that function just places a NUL on the proper position's original buffer, or the string gets just copied and the copy is treated accordingly.

My Google searches yield a lot of unrelated information, because the question seems rather generic. The IBM API finder list yielded no usable results by searches for string, fixed or NUL.

Thanks for your hints!

:wq! PoC

-- 
This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/c400-l
or email: [email protected]
Before posting, please take a moment to review the archives
at https://archive.midrange.com/c400-l.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com