PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
_realm_iter

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> Development Discussion 097
Display posts from previous:   

Author Message
OldnGrey



Joined: 04 Feb 2006
Posts: 520

PostPosted: Mon Jan 08, 2007 3:46 am    Post subject: _realm_iter Reply with quote

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

Author Message
Repsak



Joined: 05 Feb 2006
Posts: 91
Location: Denmark

PostPosted: Mon Jan 08, 2007 7:00 am    Post subject: Reply with quote

http://forums.polserver.com/viewtopic.php?t=690&highlight=realmiter

Smile

Author Message
OldnGrey



Joined: 04 Feb 2006
Posts: 520

PostPosted: Mon Jan 08, 2007 7:36 am    Post subject: Reply with quote

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..... Smile

Author Message
MuadDib
POL Developer


Joined: 13 Feb 2006
Posts: 830
Location: Indiana, USA

PostPosted: Mon Jan 08, 2007 9:27 am    Post subject: Reply with quote

iterators are great things.

Author Message
Austin
POL Developer


Joined: 30 Jan 2006
Posts: 354
Location: San Diego, California

PostPosted: Mon Jan 08, 2007 12:27 pm    Post subject: Reply with quote

_(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.

Author Message
Repsak



Joined: 05 Feb 2006
Posts: 91
Location: Denmark

PostPosted: Mon Jan 08, 2007 12:51 pm    Post subject: Reply with quote

Great indeed, but the documentations on this topic is inadequate.

Author Message
Austin
POL Developer


Joined: 30 Jan 2006
Posts: 354
Location: San Diego, California

PostPosted: Mon Jan 08, 2007 12:58 pm    Post subject: Reply with quote

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.

Author Message
MuadDib
POL Developer


Joined: 13 Feb 2006
Posts: 830
Location: Indiana, USA

PostPosted: Mon Jan 08, 2007 1:12 pm    Post subject: Reply with quote

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 Smile

Author Message
OldnGrey



Joined: 04 Feb 2006
Posts: 520

PostPosted: Mon Jan 08, 2007 9:13 pm    Post subject: Reply with quote

Austin,
does the online 096 racalac escript guide need fixing?

Quote:
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.

Post new topic   Reply to topic    PenUltima Online Forum Index -> Development Discussion 097 All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty