For 循环 PeopleCode 数组

For-Loop PeopleCode Array

是否可以循环两个数组语句?我试图将它显示出来只是为了看看我是否会得到正确的值,但事实证明我的代码只适用于单个语句:

这是代码(不工作):

&DelFrom = CreateArray();
&DelTo = CreateArray();


For &del_from = 1 To &DelFrom.Len
And &del_to = 1 To &DelTo.Len

Warning MsgGet (0, 0, &DelFrom [&del_from] "-" &DelTo [&del_to]);

End-For;

这是另一个(有效,但仅适用于 del_from):

For &del_from = 1 To &DelFrom.Len

Warning MsgGet (0, 0, &DelFrom [&del_from]);

End-For;

您不能在同一个 for 循环中循环两个不同的迭代器,但可以嵌套循环。

For &del_from = 1 To &DelFrom.Len
   For &del_to = 1 To &DelTo.Len
      Warning MsgGet (0, 0, &DelFrom [&del_from] "-" &DelTo [&del_to]);
   End-For;
End-For; 

这将使您在循环体内获得 &DelFrom&DelTo 值的每个排列。这就是您要实现的目标吗?