For loop 如何在progress4GL上为每条语句获取表中的最后一项
在我对每个语句使用For loop 如何在progress4GL上为每条语句获取表中的最后一项,for-loop,progress-4gl,For Loop,Progress 4gl,在我对每个语句使用进行迭代之后,我一直在尝试获取表的最后一项,并使用last of获取最后一项,但它获取的是所有项,而不是仅获取最后一项。这需要在每个的内完成,因为我正在用数据填充网站模板(.tpl) 表格: for each table no-lock break by table.tab-code. if last-of (table.tab-code) then do: disp "last one". end. else do:
进行迭代之后,我一直在尝试获取表的最后一项,并使用last of
获取最后一项,但它获取的是所有项,而不是仅获取最后一项。这需要在每个
的内完成,因为我正在用数据填充网站模板(.tpl
)
表格:
for each table no-lock
break by table.tab-code.
if last-of (table.tab-code)
then do:
disp "last one".
end.
else do:
disp "not the last one".
end.
end.
表
有两项
这是我的理论代码:
for each table no-lock
break by table.tab-code.
if last-of (table.tab-code)
then do:
disp "last one".
end.
else do:
disp "not the last one".
end.
end.
输出:
last one
last one
Last of将为您提供table.tab_代码每个值的最后一个实例,因此如果您有三个不同的值,它将测试每个不同值的最后一个实例
你要找的只是
if last(table.tab-code)
Last of将为您提供table.tab_代码每个值的最后一个实例,因此如果您有三个不同的值,它将测试每个不同值的最后一个实例
你要找的只是
if last(table.tab-code)
Tom Bascom可能知道我做错了什么:)另外,如果你在中断中添加“下降”,那么每个GET的第一条记录将是序列中的最后一条记录。Tom Bascom可能知道我做错了什么:)另外,如果你在中断中添加“下降”,那么每个GET的第一条记录将是序列中的最后一条记录。哦,我现在看到了,我搞砸了,谢谢你提供答案和解释+1哦,我现在看到了,我搞砸了,谢谢你提供答案和解释+1