quote:以下是引用Automann在2011-11-30 19:18:48的发言:
STEP7 V11帮助中SCL指令WHILE的帮助信息有个例子:
"Tag_Result" := WHILE "Tag_Value1" <> "Tag_Value2"
DO "Tag_Result" := "Tag_Input";
END_WHILE;
编译不能通过,删除"Tag_Result" := 后可以编译和运行。STEP 7 V5.4的SCL编译也不能通过。请大家试试是例程的问题还是我操作的问题。
1、A侠的这个示例在STEP 7 V5.5版本编译中也能通过,在Help中有使用文字说明,但却没有示例。Help文本如下:
The WHILE statement executes according to the following rules:
。Prior to each iteration of the loop body, the execution condition is evaluated.
。The loop body following DO iterates as long as the execution condition has the value TRUE.
。Once the value FALSE occurs, the loop is skipped and the statement following the loop is executed
2、从Help使用说明看,返回值数据类型应该是BOOL,但变量Tag_Result却不是BOOL类型也编译通过了!
3、按常理说,这种使用是非语法规则允许的,估计STEP 7 V5.4/V5.5版本的SCL编译系统也有Bug吧!