【发布时间】:2014-06-19 19:02:01
【问题描述】:
我是一个进步的菜鸟,实际上基本块有问题。
下面的问题在我的 if else 语句中。当它只是 if, then, else then 时它工作得很好,但是当我想在 if 部分中放入多个语句时,我必须将它放在一个块中,所以我使用 if, then do: else,然后做:但这些对我不起作用。您可以看到任何明显的错误吗?我的错误消息是 **冒号后跟空格终止语句。 (199)
INPUT FROM "r:\_content\stephen\4gl apps\dpl\output.csv".
REPEAT:
ASSIGN i_cntr = (i_cntr + 1).
myRow = "".
IMPORT DELIMITER ',' myRow.
IF myRow[5] <> "" THEN DO:
/*change this to assign 2 rows - 2 creates - 2 sets of four*/
c_fname = myRow[1].
MESSAGE
c_fname SKIP
myRow[2] SKIP
myRow[3] skip
myRow[4] skip
myRow[5] SKIP
i_cntr
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END./*end of if, then do:*/
ELSE IF myRow[5] = "" THEN DO:
MESSAGE
myRow[1] SKIP
myRow[2] skip
myRow[3] skip
myRow[4] skip
i_cntr
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END./*end of else if, then do:*/
END./*end of repeat*/
【问题讨论】:
-
提出问题是我们学习的方式:) 最好进行语法检查,它应该已经为您突出显示存在问题 - 会说类似无法理解之后 - ”结束”
-
您也不需要 ELSE 和 DO 之间的 (IF myRow[5] = "" THEN):因为只有 2 个选项 和 = :-)
标签: progress-4gl openedge