Fundamentals of NewtonScript

Iterating with foreach

Have you ever incorrectly written the bounds of a for loop? With NewtonScript, this can now be a relic of the past. As we said earlier, you do not use for loops to iterate the elements in an array or a frame. Instead, you use the NewtonScript construct foreach.

foreach with Arrays
foreach with Frames
foreach with Slot Names

An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.

Last modified: 1 DEC 1996