home bbs files messages ]

Just a sample of the Echomail archive

Cooperative anarchy at its finest, still active today. Darkrealms is the Zone 1 Hub.

   PASCAL_LESSONS      Pascal Programming Lessons      361 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 246 of 361   
   joseph larsen to All   
   Auto Message code.   
   20 Feb 16 16:40:00   
   
   Here's some more code i'm having problems with. The problem is that it   
   doesn't allow input for lines #3 through #8. What it should be doing is   
   prompting lines #1, #2, #3, #4, #5, #6, #7 and #8. It was working before, I   
   don't know what the hell is going on. If someone could look at it, and maybe   
   point me in the right direction, i'd appreciate it. Thanks.   
      
   --//--snip-----------------   
      
   procedure automsg;   
      
   Var a1 : textfile;   
   var a2 : textfile;   
   var a3 : textfile;   
   var a4 : textfile;   
   var Ch : char;   
   var s  : string;    
   automsg: string;   
   topic  : string;   
   from   : string;   
   thisdate : string;   
   YY,MM,DD : Word;   
      
   procedure ShowAutoMsg;   
      
   Begin   
           printf('automsg.dat');   
   End;   
      
   Procedure SaveAutoMsg;   
      
   Begin   
           WriteLn('');   
           if pynq('save this message?',true) then begin   
                   Write(a1);   
           End;   
   End;   
      
      
   Procedure EnterAutoMsg;   
      
   Begin   
      
   {line #1}   
      
   automsg := ('/home/imp/imp/ansi/automsg.dat');   
   Assign(a1, automsg);   
   ReWrite(a1);   
      
   WriteLn(' ');   
   WriteLn('enter automsg now... 8 lines max');   
   WriteLn(' ');   
   Write(': ');   
           inputl(s,75);   
   WriteLn(a1,''+s);   
           If s = '' then Begin   
           WriteLn('aborted');   
           SaveAutoMsg;   
           Exit   
           End;   
   Close(a1);   
      
   {line #2}   
      
   automsg := ('/home/imp/imp/ansi/automsg.dat');   
   Assign(a1, automsg);   
   Append(a1);   
      
   Write(': ');   
           inputl(s,75);   
   WriteLn(a1,''+s);   
           SaveAutoMsg;   
           Exit;   
   Close(a1);   
      
   {line #3}   
      
   automsg := ('/home/imp/imp/ansi/automsg.dat');   
   Assign(a1, automsg);   
   Append(a1);   
      
   Write(': ');   
           inputl(s,75);   
   WriteLn(a1,''+s);   
           SaveAutoMsg;   
           Exit;   
   Close(a1);   
      
   {line #4}   
      
   automsg := ('/home/imp/imp/ansi/automsg.dat');   
   Assign(a1, automsg);   
   Append(a1);   
      
   Write(': ');   
           inputl(s,75);   
   WriteLn(a1,''+s);   
           SaveAutoMsg;   
           Exit;   
   Close(a1);   
      
   {line #5}   
      
   automsg := ('/home/imp/imp/ansi/automsg.dat');   
   Assign(a1, automsg);   
   Append(a1);   
      
   Write(': ');   
           inputl(s,75);   
   WriteLn(a1,''+s);   
           SaveAutoMsg;   
           Exit;   
   Close(a1);   
      
   {line #6}   
      
   automsg := ('/home/imp/imp/ansi/automsg.dat');   
   Assign(a1, automsg);   
   Append(a1);   
      
   Write(': ');   
           inputl(s,75);   
   WriteLn(a1,''+s);   
           SaveAutoMsg;   
           Exit;   
   Close(a1);   
      
   {line #7}   
      
   automsg := ('/home/imp/imp/ansi/automsg.dat');   
   Assign(a1, automsg);   
   Append(a1);   
      
   Write(': ');   
           inputl(s,75);   
   WriteLn(a1,''+s);   
           SaveAutoMsg;   
           Exit;   
   Close(a1);   
      
   {line #8}   
      
   automsg := ('/home/imp/imp/ansi/automsg.dat');   
   Assign(a1, automsg);   
   Append(a1);   
      
   Write(': ');   
           inputl(s,75);   
   WriteLn(a1,''+s);   
           SaveAutoMsg;   
           Exit;   
      
   Close(a1);   
   End;   
      
   Procedure EnterTopic;   
      
   Begin   
      
           topic := ('/home/imp/imp/ansi/topic.dat');   
           Assign(a2, topic);   
           ReWrite(a2);   
      
           nl;   
           Write('topic: ');   
           inputl(s,50);   
           If s = '' Then WriteLn('aborted');   
           If s <> '' Then    
      
           Write(a2,'topic: '+s);   
           WriteLn(' ');   
      
           from := ('/home/imp/imp/ansi/from.dat');   
           Assign(a3, from);   
           ReWrite(a3);   
      
           write(a3,'from : '+thisuser.name);   
           writeln(a3,'%NL');   
      
           thisdate := ('/home/imp/imp/ansi/date.dat');   
           Assign(a4, thisdate);   
           ReWrite(a4);   
      
           DeCodeDate (Date,YY,MM,DD);   
           writeln(a4,'date : ', format ('%d/%d/%d ',[mm,dd,yy]));   
           WriteLn(' ');   
      
   Close(a2);   
   Close(a3);   
   Close(a4);   
   End;   
      
      
   Procedure SaveData;   
      
   Begin   
      
           shell('/usr/bin/cp /home/imp/imp/ansi/topic.dat /home/imp/imp/ansi/topi   
   .old');   
           shell('/usr/bin/cp /home/imp/imp/ansi/date.dat /home/imp/imp/ansi/date.   
   ld');   
           shell('/usr/bin/cp /home/imp/imp/ansi/from.dat /home/imp/imp/ansi/from.   
   ld');   
      
   End;   
      
      
   Procedure GetData;   
      
   Begin   
      
           shell('/usr/bin/cp /home/imp/imp/ansi/topic.old /home/imp/imp/ansi/topi   
   .dat');   
           shell('/usr/bin/cp /home/imp/imp/ansi/date.old /home/imp/imp/ansi/date.   
   at');   
           shell('/usr/bin/cp /home/imp/imp/ansi/from.old /home/imp/imp/ansi/from.   
   at');   
      
   End;   
      
      
   Procedure GetTopic;   
      
      
   Begin   
           printf('topic.dat');   
   End;   
      
      
   Procedure GetFrom;   
      
   Begin   
      
           printf('from.dat');   
   End;   
      
      
   Procedure GetDate;   
      
   Begin   
      
           printf('date.dat');   
      
   End;   
      
      
   Procedure Ask;   
      
   Begin   
           WriteLn('');   
           if pynq('change automessage?',false) then begin   
                   EnterTopic;   
                   If s = '' Then GetData;   
                   If s <> '' Then EnterAutoMsg;   
                   Exit;   
           End;   
   End;   
      
      
   procedure Quit;   
      
   Begin   
           Exit;   
   End;   
      
      
   Begin   
           SaveData;   
           GetTopic;   
           GetDate;   
           GetFrom;   
           ShowAutoMsg;   
           Ask;   
   End;   
      
   --//--snip------------------------------------------   
      
   Much thanks,   
      
   |09ignatius |07[|15cia|07]   
      
   --- Mystic BBS v1.12 A3 (Linux)   
    * Origin: catch22bbs.com >>>  >> > (1:340/800)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca