ForEach Macro

Started by Charles Pegge, February 16, 2025, 06:44:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Charles Pegge

A very simple implementation of ForEach:

def ForEach
===========
scope
int i
for i=lbound(%1) to ubound(%1)
  %2
next
end scope
end def

'TEST
'====
int a[2]
ForEach a { a[i]=i }
ForEach a { print a[i] }
'ForEach obj { obj[i].id=i }