home *** CD-ROM | disk | FTP | other *** search
-
- -=( BBS Editor )=-
-
-
- The BBS editor unit implements a simple online line editor. In it's simplest
- form it's very easy to use. Allocate a new buffer variable on the heap,
- pass it to the editor procedure and on return, do something with the text
- and dispose the buffer.
-
- The strings and keys the editor uses are definable by the programmer. This
- is not only to make it more flexible, but also for the multilanguage support.
-
- An example:
-
-
-
- New(Body);
- If Body=Nil
- Then Begin
- Foss.WriteLnF('^1 Not enough memory!!^0');
- Foss.CloseF;
- Exit;
- End;
-
- FillChar(Body^,SizeOf(Body^),#00);
-
- { You can add text, quote from a message and such.. }
-
- Lines:=2;
- Body^[0]:='* This is the BBSeditor demo:';
- Body^[1]:='';
-
- LineEditor(Foss,Body,Lines,30); { 30 is the maximal number of lines. }
- { The maximum the editor can handle is 255 }
- Foss.WriteLnF('');
- If Lines=0
- Then Foss.WriteLnF('Text aborted...')
- Else Foss.WriteLnF('Text saved...');
-
- { Dispose the Editor buffer and free memory }
-
- Dispose(Body);
-
-