|
in order to get a "real" RPG string from a C string pointer, you should really modify your code as shown below. %STR is the opposite of the Options(*String) - it dereferences the C string and strips the null terminator, padding the receiving field with blanks if required. No need for the pointer definition (which could have been omitted anyway since the use of the Based keyword causes it to be defined) or indeed the Based keyword on the variable. Much simpler and I suspect more obvious to anyone who doesn't understand C functions and pointers since the value no longer arrives in rtnstr "by magic". It is clearly being assigned. It would also be a nice touch to make the receiving field rtnstr a VARYING field. d rtnstr s 20 c rsnstr = %STR ( founddir ('/') ) c dsplay rtnstr Jon Paris Partner400
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.