|
So what you're doing here is correct -- except that you will need to call %STR afterwards to remove the null from the result. For example:
Dresult s 64a varying
.
.
C MOVE 64 PW_SIZE
C MOVE 3 PW_FLAGS
C CALLP PW_RAND ( PW_BUF: PW_SIZE: PW_FLAGS: *null )
C
C eval result = %str(%addr(PW_BUF))
This result is consistent with the original problem of calling the routine but not providing the 4th parameter.
When you leave the parameter off of the parameter list, the system uses whatever "by chance" happens to be in memory at that spot in the parameter list. So if it happens to be a valid null pointer, the program would work as expected. If it does not, it'd crash with MCH3601.
You say that your version does not have this parameter, which seems unlikely to me as the 'pw_rand.c' source on GitHub was last changed on Aug 6, 2017. That's almost 3 years old.
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.