Why are you using Qp0zGetSysEnv and not getEnv? Jeff
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
Using Environment Variables in RPG
Collapse
X
-
Using Environment Variables in RPG
cbougher wrote: > > I figured it out with the help of Bob Cozzi. I was passing a parameter incorrectly. I have pasted the correct code below. > I don't think you should use options(*string) on the second parameter. options(*string) should be used for input-only parameters, but the second parameter is an output parameter. Just having the VALUE keyword will make it work. Coding options(*string) won't cause you any problems, as long as you pass a pointer and not a character string. A problem would only occur if you did code a character string as a parameter, by accident, but better not to even allow the possibility of passing a character string. Also, I wouldn't code options(*string) on the last parameter. It's a reserved parameter, so you should make any assumptions about how it might be used. (According to the documentation, you can only pass *NULL anyway. Having the VALUE keyword is sufficient there too.)
Comment
-
Using Environment Variables in RPG
I'm having trouble getting an api to work. This is the prototype I'm using (see code below) Is there anything wrong with this? I allocate enough space to the Value Ptr and when I call the proc passing in the key, the pointer, the number of bytes alloocated(1024), 0 and *null I get back a numm pointer, size has 11 CCSID has -1199.... and the return code is 0. TIA
Code
Comment
Comment