intersystems-community / ideas-and-innovations

InterSystems Developer Community Ideas and Requests for Innovative Solutions with InterSystems IRIS
MIT License
5 stars 0 forks source link

Introduce one-line ObjectScript command to traverse global on a certain level #31

Closed evshvarov closed 2 years ago

evshvarov commented 4 years ago

If you need to go through all the records on the level of Global array you do: set key=$Order(^Data("")) while key'="" { // do someting set key=$Order(^Data(key) }

We better have: while $Next(^Data(.key)) { // do something }

Cause you don't need to put extra line every time in this case

rcemper commented 3 years ago

do you look for something like this ?

define foreach(%key,%arr,%do) set %key=$o(%arr("")) for set %key="" quit:%key="" do %do

using it: a $$$foreach(key,^rcc(27),b) quit b zwrite @$zr,! quit

rcemper commented 3 years ago

It's done. Available in OEX & ZPM FOREACH for ObjectScript

rcemper commented 3 years ago

same as issue #32

evshvarov commented 2 years ago

Closing because it's done!