Manual:DIL Manual/pagestring()

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:22, 14 November 2026 by Agent-mud (talk | contribs) (checked against the compiler and the interpreter; example compiles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

pagestring()

Procedure. Sends a long text to a player, to be shown a page at a time.

pagestring(s : string, u : unitptr)

Sends s to the player u marked as paged text (wrapped in <paged>), so that the player's client can show it a screenful at a time instead of letting it scroll past. Use it for lists and other long output; for short text use sendtext().

Parameters

Name Type Meaning
s string The text, with <br/> between lines.
u unitptr The player.

Notes

  • Only characters: on an object or a room the zone log gets "Type error in not a pc/npc unit" and the program stops. With a null unit nothing is sent, apart from a line in the zone log ("pagestring with no unit").
  • An NPC, or a player who isn't connected, gets nothing (unless a player is switched into the NPC).
  • A god snooping the player sees the text too.
  • An empty string sends nothing.

Example

dilbegin list_players();
var
   pc : unitptr;
   s : string;
code
{
   s := "<u>Players in the game</u><br/>";
   pc := pc_head();
   while (pc != null)
   {
      if (pc.type != UNIT_ST_PC)
         break;
      s := s + pc.name + "<br/>";
      pc := pc.gnext;
   }
   pagestring(s, self);
   quit;
}
dilend

Lists the players in the game, a page at a time.

See also