Items in alt.bbs.mystic

Subject:Re: MsgEditor MPL Questions
Date:Mon, 5 Nov 2012 10:20:00 +0000
From:"Gryphon" <gryphon@1:250/100.remove-ysm-this>
Newsgroups:alt.bbs.mystic
  To: mobbyg
On 11-05-12, mobbyg said the following...
 
mo> I read the what's new txt file for A20, and I have a question, maybe more
mo> once I get an answer on this question, about the MsgEditor function:
mo> 
mo> My plan is to write a news/bulletin mangement script. It would let you
mo> write up a news/bulletin item, and let the sysop manage them as well as
mo> displaying them to users that log on.  
mo> 
mo> Basically, will the MsgEditor function allow me to save the file to a
mo> folder of my choosing? If so, how?

Here's a little program I wrote to do just what you are asking.  Basically,
you have to output all the lines into a file.

Procedure Main
Var
  Lines    : Integer = 0;
  WrapPos  : Integer = 254;
  MaxLines : Integer = 200;
  Forced   : Boolean = False;
  Template : String  = 'textedit';
  Subject  : String  = 'My subject';
  Count    : Integer;
  F1       : File
  S,FX     : String

Begin

     FX:=ParamStr(1)

     If FileExist(FX) Then Begin
          fAssign(F1,FX,66)
          fReset(F1)
          If IOResult = 0 Then Begin
               While Not fEof(F1) Do Begin
                    Lines:=Lines+1
                    fReadLn(F1,S)
                    MsgEditSet(Lines,S)
               End
          End
          fClose(F1)
     End

     MaxLines:=Lines+200

     SetPromptInfo(1, 'MsgTo');  // if template uses &1 for "To:" display

     If MsgEditor(1, Lines, WrapPos, MaxLines, Forced, Template, Subject) Then 

          fAssign(F1,FX,66)
          fReWrite(F1)
          For Count := 1 to Lines Do Begin
               fWriteLn(F1,MsgEditGet(Count));
          End

     End
End

Begin
     Main
End
OO

pq gryphon
88 of
bd cyberia

--- Mystic BBS v1.10 A20 (Linux)
 # Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX (77:1/188)
 * Origin: FidoNet <-> SciNet EchoGate! (1:250/100.0)