Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1271795
  • 博文数量: 287
  • 博客积分: 11000
  • 博客等级: 上将
  • 技术积分: 3833
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-16 08:43
文章分类
文章存档

2013年(15)

2012年(17)

2011年(17)

2010年(135)

2009年(85)

2008年(18)

分类: 系统运维

2010-06-04 16:53:56

Get Value of Environment Variable (Extended)

Here's the prototype that is used in the CGILIB (similar to CGIDEV2) D Qp0zGetEnv PR * ExtProc('Qp0zGetEnv') D envvar * VALUE OPTIONS(*STRING) D nCCSID 10I 0 The 2nd parm, CCSID, can be set to 0 for the current CCSID. Here's the wrapper I built for CGILIB so that you don't have to deal with the C string return values: P GetEnvVar B Export D GetEnvVar PI 65535A VARYING D pInEnv * VALUE OPTIONS(*STRING) D pEnv S * Inz D nCCSID S 10I 0 Inz(0) C eval pEnv = Qp0zGetEnv(pInEnv : nCCSID) C C if pEnv = *NULL C return '' C endif C return %str(pEnv) P GetEnvVar E CGILIB is available in the RPG xTools at Thanks to Bob Cozzi

阅读(870) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~