Difference between revisions of "Foreach"
→Example
imported>Odessa (Expanded and clarified) |
imported>Odessa |
||
Line 41: | Line 41: | ||
foreach rItem <- rActor | foreach rItem <- rActor | ||
if rItem.IsEquipped | if rItem.IsEquipped | ||
rItem. | rItem.UnequipMe | ||
endif | endif | ||
loop | loop | ||
; Will | ; Will unequip all equipped items from rActor | ||
</pre> | </pre> | ||
Line 104: | Line 104: | ||
</pre> | </pre> | ||
Note that above we reference <b>Entry["value"]</b> in the [[Print]] function directly, rather than use an intermediary variable (<b>let SomeVar := Entry["value"]..</b>). This is only possible when using NVSE aware functions or the [[Script Compiler Override]]. | Note that above we reference <b>Entry["value"]</b> in the [[Print]] function directly, rather than use an intermediary variable (<b>let SomeVar := Entry["value"]..</b>). This is only possible when using NVSE aware functions or the [[Script Compiler Override]]. | ||
==See Also== | ==See Also== | ||
*[[While]] | *[[While]] |