Page 1 of 1

_realm_iter

Posted: Sun Jan 07, 2007 11:46 pm
by OldnGrey
Hi,
What is _realm_iter
I see it in the distro with moongates and the decay system, but don't see it defined anywhere.

Thanks in advance

Posted: Mon Jan 08, 2007 3:00 am
by Repsak

Posted: Mon Jan 08, 2007 3:36 am
by OldnGrey
Well, I'm amazed. It really goes against the grain using something I can't see declared.... Thanks Repsak.
Maybe I will try the distro decay system now..... :)

Posted: Mon Jan 08, 2007 5:27 am
by MuadDib
iterators are great things.

Posted: Mon Jan 08, 2007 8:27 am
by Austin
_(var)_iter is a variable you get inside a foreach loop that tells you where you are in it.

foreach tom in (array)

_tom_iter would give you a number and tom would be the value of that index

foreach entry in (dictionary)

_entry_iter would give you the key name you're using and entry would be the value.

Posted: Mon Jan 08, 2007 8:51 am
by Repsak
Great indeed, but the documentations on this topic is inadequate.

Posted: Mon Jan 08, 2007 8:58 am
by Austin
Its existed inside of POL for a very, very long time.
It was changed slightly in 095 and was documented.
I think its also noted in an updated version of Racalac's script guide.

Its been discussed on the POL forums numerous times.
*Its been used in distro scripts for a while.



* Most learn from looking at other scripts than any other resource.

Posted: Mon Jan 08, 2007 9:12 am
by MuadDib
Forums is a good place for information, that's why I read most all posts, not just the ones that look interesting, or pertain to problems of my own :)

Posted: Mon Jan 08, 2007 5:13 pm
by OldnGrey
Austin,
does the online 096 racalac escript guide need fixing?
var a := array{"A", 1000};
foreach i in ( a )
Print(_value_iter);
Print(value);
endforeach

_var_iter seems so useful..... I must invent a reason to use it.