<?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%2Finside</id>
	<title>Manual:DIL Manual/inside - 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%2Finside"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/inside&amp;action=history"/>
	<updated>2026-11-23T19:20:43Z</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/inside&amp;diff=2878&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/inside&amp;diff=2878&amp;oldid=prev"/>
		<updated>2026-11-14T23:10:43Z</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;= inside =&lt;br /&gt;
'''Field''' (unitptr, read-only; units: all).&lt;br /&gt;
&lt;br /&gt;
 u.inside : unitptr&lt;br /&gt;
&lt;br /&gt;
The first unit inside &amp;lt;code&amp;gt;u&amp;lt;/code&amp;gt;, or null when it is empty. Follow [[Manual:DIL Manual/next|next]] for the rest. For a room that is everything in it (characters, objects, rooms within it); for a character, everything it carries, worn and not worn; for a container, its contents.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* It can't be assigned (vmc: &amp;quot;Illegal lvalue&amp;quot;). Put units in with [[Manual:DIL Manual/link()|link()]].&lt;br /&gt;
* Only what is directly inside: the contents of a sack in a room are in &amp;lt;code&amp;gt;sack.inside&amp;lt;/code&amp;gt;, not in the room's list.&lt;br /&gt;
* Worn objects are in the list too: test [[Manual:DIL Manual/equip|equip]] to tell them apart.&lt;br /&gt;
* A &amp;lt;code&amp;gt;while&amp;lt;/code&amp;gt; loop that moves or destroys the units it walks goes wrong; use [[Manual:DIL Manual/foreach()|foreach()]] for that.&lt;br /&gt;
* On null it fails.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin integer pack_count(pc : unitptr);&lt;br /&gt;
var&lt;br /&gt;
   u : unitptr;&lt;br /&gt;
   n : integer;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   u := pc.inside;&lt;br /&gt;
   while (u)&lt;br /&gt;
   {&lt;br /&gt;
      if (not u.equip)&lt;br /&gt;
         n := n + 1;&lt;br /&gt;
      u := u.next;&lt;br /&gt;
   }&lt;br /&gt;
   return (n);&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Counts what a character carries without wearing it.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/outside|outside]]&lt;br /&gt;
* [[Manual:DIL Manual/next|next]]&lt;br /&gt;
* [[Manual:DIL Manual/foreach()|foreach()]]&lt;br /&gt;
* [[Manual:DIL Manual/equip|equip]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>