Category : C Source Code
Archive   : MONO.ZIP
Filename : MDA.CLS

 
Output of file : MDA.CLS contained in archive : MONO.ZIP
/* This class opens up a dll that allows you to print objects to a secondary monochrome monitor. This can be usefull for debugging code. The character and line positioning variables in the dll are shared by all copies of the class, so you can create several objects of this class and they will not write overtop of each other. If you do open several objects, make sure you close each one. */!!

inherit(Object, #MDA, #(dll /* the name of the MDA dll */
), 2, nil)!!

now(class(MDA))!!

/* Modified: 1991/09/18/10:19 */
/* initialize a new secondary monitor dll */
Def new(self)
{ ^init(new(self:Behavior));
}!!

now(MDA)!!

/* Modified: 1991/09/18/10:58 */
/* Enables writing to the monitor. Writing is enabled by default. */
Def on(self)
{ pcall( procs(dll)[#MONOON] );
}
!!

/* Modified: 1991/09/18/10:51 */
/* Disable writing to the monitor. This allows you to leave the print
calls to this class in your code and disable all of them at once with one
call. */
Def off(self)
{
pcall( procs(dll)[#MONOOFF] );
}
!!

/* Modified: 1991/09/18/10:17 */
/* free the dll */
Def close(self)
{
free(dll);
}
!!

/* Modified: 1991/09/18/10:57 */
/* load the dll */
Def init(self)
{
dll := new(Classes[#Library]);
setName(dll, "c:\actor\mda\monodll.dll");
add(dll, #MPRINT, nil, #(0 1) );
add(dll, #MONOOFF, nil, nil );
add(dll, #MONOON, nil, nil );
load(dll);
}
!!

/* Modified: 1991/09/18/10:18 */
/* Advance to the next text line. If on the last line of
the page, scroll. */
Def eol(self)
{
/* tell MPRINT to generate a new line, and let it figure out whether
to scroll or not by sending it a null string */
pcall( procs(dll)[#MPRINT], 1, asciiz("") );
}!!

/* Modified: 1991/09/18/09:36 */
/* Print the object, as a string, out to B&W monitor,
with CR_LF at end. */
Def printLine(self, object)
{ if print(self, object)
then eol(self);
else ^nil
endif;
}
!!

/* Modified: 1991/09/18/10:19 */
/* Print the object, as a string, out to B&W monitor. */
Def print(self, object | aStrm, aStr)
{
aStrm := streamOver("");
printOn(object, aStrm);
aStr := collection(aStrm);
/* the first parameter to MPRINT is a logical flag that is used to
generate a new line after printing. false = no new line. */
pcall( procs(dll)[#MPRINT], 0, asciiz(aStr) );
}
!!


  3 Responses to “Category : C Source Code
Archive   : MONO.ZIP
Filename : MDA.CLS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/