Start Info Community Spielen
 
 

Morgengrauner Dokumentation

Dateipfad: /home/mud/mudlib/doc/LPC/for

NAME
        for

SYNTAX
        for(init; expr2; expr3) statement;

DESCRIPTION
        Execute  once. Then, while  returns a non-zero
        value, execute . Every time  has been
        executed, or a 'continue' statement has been executed, execute
         before next loop.

         is usually a series of one or more expressions (remember
        that assignments are expressions, too), separated by commas.
        Additionally it is also allowed to define new local variables
        here and assign them an initial value. The scope of such variables
        is the whole for statement.

        Examples for legal  expressions are:

           for (i = 0; ...
           for (i = 0, j = 0; ...
           for (i = 0, int j = i; ...
           for (int j = 4; ...

        Illegal  expressions are:

           for (int i; ...      : no value assigned
           for (int i += 4; ... : only plain assignments allowed

        A 'break' in the 'statement' will terminate the loop. A
        'continue' will continue the execution from the beginning of
        the loop.

SEE ALSO
    foreach(LPC), if(LPC), do-while(LPC), while(LPC), switch(LPC)


zurück zur Übersicht

YOUTUBE | FACEBOOK | TWITTER | DISCORD | FEEDBACK | IMPRESSUM | DATENSCHUTZ 1992–2023 © MorgenGrauen.