Difference between revisions of "SaveIP"
m
Reverted edit of Hd4Uli, changed back to last version by DragoonWraith
imported>Hd4Uli m |
imported>TS7 m (Reverted edit of Hd4Uli, changed back to last version by DragoonWraith) |
||
Line 1: | Line 1: | ||
A command for [[:Category:Oblivion Script Extender|Oblivion Script Extender]] | |||
[[Category:OBSE Flow Control Functions]] | [[Category:OBSE Flow Control Functions]] | ||
'''Syntax:''' | '''Syntax:''' | ||
Line 20: | Line 20: | ||
; update the loop counter | ; update the loop counter | ||
set var to var | set var to var + 1 | ||
; we only want to go through the loop three times, so check the loop counter | ; we only want to go through the loop three times, so check the loop counter | ||
Line 40: | Line 40: | ||
A more familiar For-loop in a normal programming language would look like this: | A more familiar For-loop in a normal programming language would look like this: | ||
<pre>for (i = 0; i < 5; i | <pre>for (i = 0; i < 5; i++) | ||
{ | { | ||
for (j = 0; j < 3 ; j | for (j = 0; j < 3 ; j++) | ||
{ | { | ||
//Do Something | //Do Something | ||
Line 56: | Line 56: | ||
Label 1 ; top of inner loop | Label 1 ; top of inner loop | ||
PrintToConsole "i = %.0f, j = %.0f" i, j | PrintToConsole "i = %.0f, j = %.0f" i, j | ||
set j to ( j | set j to ( j + 1 ) | ||
if ( j < 3 ) | if ( j < 3 ) | ||
GoTo 1 ; equivalent to RestoreIP 1 | GoTo 1 ; equivalent to RestoreIP 1 | ||
endif | endif | ||
set i to ( i | set i to ( i + 1 ) | ||
if ( i < 5 ) | if ( i < 5 ) | ||
GoTo 0 | GoTo 0 |