[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: single line Mata do-while cycle

From   Stas Kolenikov <>
Subject   st: single line Mata do-while cycle
Date   Tue, 22 Sep 2009 12:32:07 -0500

I was expecting this snippet of code to work:

do k=k+1 while (k<10)


: k=0

: do k=k+1 while (k<10)
'while' found where almost anything else expected

Breaking this into multiple lines does not help:

: do k=k+1
nothing found where 'while' expected

However, this one works:

do k=k+1; while (k<10)

Is that the case of "significant" semicolons per [M-2] semicolons? I
know that I sometimes need to use semicolons after -if- to indicate
absence of -else- statement in crooked branching code.

Stas Kolenikov, also found at
Small print: I use this email account for mailing lists only.
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index