有人知道我如何在RPG IV中做模数运算吗?
我试过%2 = 0
,但不准确!
如果你有解决方案,我很感兴趣。
dcl-s slash varchar(20);
dcl-s antiSlash varchar(20);
dcl-s i packed(3:0);
dcl-s j packed(3:0);
dcl-s k packed(3:0);
dcl-s message varchar(20);
dcl-s waitInput char(1);
FOR i = 1 by 1 to 10;
slash += '/';
ENDFOR;
FOR j = 1 by 1 to 10;
antiSlash += '';
ENDFOR;
FOR k = 1 by 1 to 6;
IF k % 2 = 0;
message = %char(slash);
dsply message ' ' waitInput;
ENDIF;
ENDFOR;
*INLR = *on;
查看文档
Tradition Fix-format Free Format Syntax
Division Remainder MVR (Move Remainder) %REM (Return Integer Remainder)
所以对于你的代码if %rem(k:2) = 0;