OBJECT:
/lib/more
AUTHOR:
Softbyte
VERSION:
V1.0
LAST UPDATE:
Thu Feb 5 23:21:30 1998
SYNOPSIS:
include <daemons.h>
MORE->...
or
inherit "/lib/more";
( it is possible to inherit the file, but not recommended )
DESCRIPTION:
Multiuser aware more that uses the message-system to more a
file or a text. The more command can ignore HTML comments and
show text parts.
Interactive commands are:
[CR], d, + : next page
u , b, - : last page
f : go to the first page
l : go to the last page
<nr> : go to page <nr>
/<regexp> : scan forward until line matching <regexp>
/ : repeats last /<regexp> command
a : redisplay current page
c<COLOR> : mark regexp's with this color
full : Shows the full document if only a part is shown
partial : Shows only a specific part of a document
? : this help
q : quits more
PUBLIC FUNCTIONS
varargs int more ( mixed fname, int mode, int chunk, int itrans,
Mores a text or file to this_player(). The only obligatory argument is
fname.
Parameter:
string|string * str
The filename or the text which should be shown. It depends on the
mode parameter how this argument is interpreted. If str is an array
of strings the mode paramter is automatically set to MORE_STRING==2
int mode
Mode flags are:
0: default
1 : do not write 'looks at a complete different reality'
2 : filename is a string
4 : HTML comments are suppressed
8 : No file heade is shown
16 : The more prompt after the last page is shown
int chunk
If 'chunk' is given, it is used instead of P_PAGESIZE.
Default is the pagesize of the player
int itrans
1: Should the wrapped text be indented
0: no (default)
int *partial
If an integer array of size 2, i.e. ({from,to}) is given only
the lines in this range are shown. Switcbhing to full mode is
possible via an interactive command.
string fun
After the text was mored the function fun in object ob is called
by call_other(ob, fun)
object ob
The object in which the above function will be called. Default is
this_object()
varargs int More (mixed fname, int chunk)
Mores a file to this_player(). The only obligatory argument is
fname. This is an easy to use version of more() for files.
Parameter:
string fname
The filename which should be shown.
int chunk
If 'chunk' is given, it is used instead of P_PAGESIZE.
Default is the pagesize of the player
varargs int smore (mixed text, int chunk, object ob, string fun, int end)
Mores a text to this_player(). The only obligatory argument is
str. This is an easy to use version of more() for strings.
Parameter:
string|string * str
The text or text array which should be shown.
int chunk
If 'chunk' is given, it is used instead of P_PAGESIZE.
Default is the pagesize of the player
string fun
After the text was mored the function fun in object ob is called
by call_other(ob, fun). Setting a function will force the flag
MORE_PROMPTLAST=16 to be set, i.e. wait after the last page for
the more prompt
object ob
The object in which the above function will be called. Default is
this_object()
int end
Unused
int SMore (mixed text)
Mores a text to this_player(). This is an very easy to use version of
smore() for strings.
Parameter:
string|string * str
The text or text array which should be shown.
TODO
Replace BMore ,...
KNOWN BUGS
Colour is not saved in the player
INHERITANCE
more
|-lib/more
EXAMPLES
More /std/player.c without notifying the surroundings
"/lib/more"->more("/std/player.c", 1 );
More /std/player.c with notifying the surroundings if the player is
not invisbile
"/lib/more"->More("/std/player.c");
More a string
"/lib/more"->more("Hello this is a test...\n",2);
"/lib/more"->SMore("Hello this is a test...\n");
More a file not ignoring HTML comments but notifying the environment
"/lib/more"->more("/std/player.c", 4 );
SEE ALSO
messages(C), string(L), pagesize(prop)