Caché Basic Reference
For Each...Next
|
|
For Each element In group [statements] [Exit For] [statements] Next [element]
Variable used to iterate through the elements of the collection or array. For collections, element can only be a Variant variable, a generic Object variable, or any specific object variable. For arrays, element can only be a Variant variable. | |
Name of an object collection or array. | |
One or more statements that are executed on each item in group. |
Erase ^RandomData ' Generate some random nodes For i = 65 to 90 If Rnd(i) > .5 Then ^RandomData(Chr(i),"subnode")="data" Else ^RandomData(Chr(i))="data" End If Next PrintLn "Traverse forwards" For each k1 in ^RandomData PrintLn k1 For each k2 in ^RandomData(k1) Print k1,vbTAB,k2 If Exists(^RandomData(k1,k2)) and vbHasValue Then Print " = ",^RandomData(k1,k2) End If PrintLn Next Next
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
|
Content for this page loaded from RBAS_cforeach.xml on 2019-02-22 02:07:25
|