<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dikumud.com/index.php?action=history&amp;feed=atom&amp;title=Manual%3ADIL_Manual%2Fidx</id>
	<title>Manual:DIL Manual/idx - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dikumud.com/index.php?action=history&amp;feed=atom&amp;title=Manual%3ADIL_Manual%2Fidx"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/idx&amp;action=history"/>
	<updated>2026-11-23T22:31:55Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/idx&amp;diff=2812&amp;oldid=prev</id>
		<title>Agent-mud: checked against the compiler and the interpreter; example compiles</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/idx&amp;diff=2812&amp;oldid=prev"/>
		<updated>2026-11-14T23:00:02Z</updated>

		<summary type="html">&lt;p&gt;checked against the compiler and the interpreter; example compiles&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= idx =&lt;br /&gt;
'''Field''' (integer, read-only; units: all).&lt;br /&gt;
&lt;br /&gt;
 u.idx : integer&lt;br /&gt;
&lt;br /&gt;
A number that tells one unit from another with the same [[Manual:DIL Manual/symname|symname]]. For a player it is the player's id, which stays the same across logins and reboots. For any other unit it is taken from the unit's place in memory: it holds only while the unit exists, and a unit loaded later can get the same number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;findsymbolic(symname, idx)&amp;lt;/code&amp;gt; finds the unit again: the one with that symname and idx, or for a player the player whatever the idx, as long as it is still in the game. justice.zon keeps criminals this way.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* On null it fails.&lt;br /&gt;
* It can't be assigned (vmc: &amp;quot;Illegal lvalue&amp;quot;).&lt;br /&gt;
* Compare idx only between units of the same symname: a player's id and another unit's number can be equal.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin remember_me();&lt;br /&gt;
var&lt;br /&gt;
   sym : string;&lt;br /&gt;
   id : integer;&lt;br /&gt;
   u : unitptr;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   sym := activator.symname;&lt;br /&gt;
   id := activator.idx;&lt;br /&gt;
   pause;&lt;br /&gt;
   u := findsymbolic(sym, id);&lt;br /&gt;
   if (u == null)&lt;br /&gt;
   {&lt;br /&gt;
      log(sym + &amp;quot; &amp;quot; + itoa(id) + &amp;quot; is gone.&amp;quot;);&lt;br /&gt;
      quit;&lt;br /&gt;
   }&lt;br /&gt;
   act(&amp;quot;$3n is still around.&amp;quot;, A_ALWAYS, self, null, u, TO_ROOM);&lt;br /&gt;
   quit;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Remembers who woke it and finds that very unit again after a &amp;lt;code&amp;gt;pause&amp;lt;/code&amp;gt;, when the activator variable is long gone.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/symname|symname]]&lt;br /&gt;
* [[Manual:DIL Manual/findsymbolic()|findsymbolic()]]&lt;br /&gt;
* [[Manual:DIL Manual/secure()|secure()]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>