Page 1 of 1

do loop syntax updated??

Posted: Tue Jun 09, 2026 2:08 pm
by randal_verbrugge
Hello!
I am not sure if this is documented, but using {.} seems to work instead of using an end do statement, as in:

do i=1,3 {
dis "i = " i
}

Is this something we can rely upon?

thanks,
Randy

Re: do loop syntax updated??

Posted: Mon Jun 15, 2026 12:18 pm
by TomDoan
} has always been synonymous with END. This appears to work because the { (which is synonymous with BEGIN) at the end of the line gets eaten by the parser. On the other hand,

do i=1,3
{
?i
}

(where the { is on a separate line) doesn't work as the } is closing the {} block and not the do loop.

do i=1,3 {
?i
}

works because { doesn't do anything so } is an END to the DO loop.