免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2377 | 回复: 3
打印 上一主题 下一主题

rpg里怎么使用"%"(函数) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-02-01 08:25 |只看该作者 |倒序浏览
RT
我想在RPG里使用%DECPOS这个函数~

论坛徽章:
0
2 [报告]
发表于 2008-02-01 08:58 |只看该作者
%DECPOS(numeric expression)
%DECPOS returns the number of decimal positions of the numeric variable or
expression. The value returned is a constant, and so may participate in constant
folding.
The numeric expression must not be a float variable or expression.
See Figure 196 on page 478 for an example of %DECPOS with %LEN.
*..1....+....2....+....3....+....4....+....5....+....6....+....7...+....
D*Name++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++
D p7 s 7p 3 inz (8236.567)
D s9 s 9s 5 inz (23.73442)
D result1 s 5i 0
D result2 s 5i 0
D result3 s 5i 0
/FREE
result1 = %decpos (p7); // "result1" is now 3.
result2 = %decpos (s9); // "result2" is now 5.
result3 = %decpos (p7 * s9);// "result3" is now 8.
/END-FREE


COPY FROM "ILE RPG Reference"

论坛徽章:
0
3 [报告]
发表于 2008-02-01 09:00 |只看该作者
这好像是在RPGLE吧,这个例子我也看到过
我想问得是在RPG里!
谢谢

论坛徽章:
0
4 [报告]
发表于 2008-02-01 09:09 |只看该作者
RPGIII 不支持这种%内置函数,但好像可以用scan吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP