Device Monitoring Studio - Monitor, log and analyze data coming through PC ports and connections
Download Device Monitoring Studio Hide this button

for Statement

for statement has the following syntax:

for (init-expr; condition-expr; increment-expr)

for statement is equivalent to the following construct:

while (condition-expr)

It evaluates statements in statement-block while condition-expr evaluates to a non-zero value.

Note that unlike C/C++, all for statement expressions must be present and cannot be omitted. Device Monitoring Studio does not support unary operators like ++, --, +=, -= and others, so increments must be specified in the form of i = i + 1 instead of ++i.

init-expr must have the following syntax:

var name = expr

For example,

for (var i = 0; i < 10; i = i + 1)
    int a;