continue

This forum serves as MSCI Reference at EGOSOFT. It's Read-Only for non MSCI Group members.

Moderators: Scripting / Modding Moderators, MSCI Moderators

Locked
mark_a_condren
Posts: 1385
Joined: Wed, 3. Aug 05, 05:05
x3tc

continue

Post by mark_a_condren » Fri, 10. Sep 10, 16:14

continue


Immediately bypasses any remaining code inside a 'while' loop's code block.
The while's test is then re-run and the loop begins again or terminates if the test fails.


Example:

$loop = 5
while $loop > 0
| dec $loop =
| if $loop =< 2
| | continue
| else
| | write to player logbook = $loop
| end
|@ = wait 100 ms
end

This would result in 5, 4 and 3 being written to the players logbook but 1 and 2 would be missed as the 'if' condition passed, so the 'continue' was used.


Command Location:

Alex Vanderbilt
Winner X3 Sektorquest
Posts: 2120
Joined: Thu, 4. May 06, 12:07
x3tc

[TiP][49] 286640

Post by Alex Vanderbilt » Fri, 1. Oct 10, 14:29

continue

Umgeht sofort den verbleibenden Code innerhalb einer while-(während)-Schleife.
Der while-Test endet dann entweder in der erneuten Ausführung der Schleife oder in der Beendigung, wenn der Test fehlschlägt.

Beispiel:

$loop = 5
while $loop > 0
| dec $loop =
| if $loop =< 2
| | continue
| else
| | write to player logbook = $loop | end
|@ = wait 100 ms
end

Hier würden 5; 4 und 3 in das Spielerlogbuch geschrieben, da sie größer als 2 sind. 1 und 2 jedoch würden ausgelassen weren, da die if-Bedinung erfüllt wurde, und continue vom Code angewendet wurde.


Zu finden unter:

User avatar
Capux
Posts: 2141
Joined: Sat, 31. Oct 09, 22:17
x4

[39] 286640

Post by Capux » Thu, 21. Oct 10, 21:35

continue


Salta le restanti istruzioni del ciclo 'while' e lo fa ricominciare.
Il ciclo controlla le condizioni, quindi ricomincia o termina normalmente a seconda dell'esito del controllo.


Esempio:

$loop = 5
while $loop > 0
| dec $loop =
| if $loop =< 2
| | continue
| else
| | write to player logbook = $loop
| end
|@ = wait 100 ms
end

Questo frammento scriverà '5', '4' e '3' nel diario di bordo del giocatore, ma quando entra nel ciclo 'if' viene usata l'istruzione 'continue' e quindi i numeri restanti, '1' e '2', non vengono scritti in quanto il restante codice viene ignorato.


Posizione dell'istruzione nella lista:

Locked

Return to “MSCI Reference”