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



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


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.