Manual:DIL Manual/pagestring()
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.