Section One BBS

Welcome, Guest.


Subject: [ANSI] rgcast/2 pascal source os/2 Date: Sat Dec 02 2017 07:53 pm
From: dream master To: All

This is the os/2 versiion
PROGRAM RGCast2;
                
                USES crt, dos, x, cwrite;
                                         
                                         {$I d:\u\records.pas}
                                                              {of course you're 
going to need to change                   some things}
                                                      {when you get this back...
 the $I for instance                            :) }
                                                    
                                                    CONST
                                                           Version = '1.6Γ';
                                                                            
                                                                            VAR
                                                                                
 Stat : FILE OF GeneralRec;    {RENEGADE.DAT}
                                               StatS : GeneralRec;           {St
ructure for RENEGADE.DAT}
                           Node : FILE OF NodeRec;       {MULTNODE.DAT}
                                                                         NodeS :
 NodeRec;              {Struct         ure for MULTNODE.DAT}
                                                              TotalMsg, Name, Da
te, Message : STRIN                    G;
                                           MFile : FILE; {Message.#}
                                                                      t, ASWFile
 : TEXT;
  line : string;
                
                PROCEDURE cfgread;
                                  VAR
                                       cfg : TEXT;
                                                  BEGIN
                                                         ASSIGN (cfg, 'rgcast.cf
g');
      reset(CFG);
                   READLN (cfg, line);
                                        CLOSE (cfg);
                                                    END;


  (* -------------------- Read the message file -------------------- *)
                                                                       
                                                                       PROCEDURE
 FileRead;
            (*Var
                   ASWFile : Text;*)
                                    BEGIN
                                           ASSIGN (ASWFile, StatS.MiscPath + 'RG
CST' + PARAMSTR (1) + '.ASW');
                               {ASSIGN (ASWFile, StatS.MiscPath + 'RGCAST.ASW');
}
   {$I-}
          RESET (ASWFile); {$I+}
                                  IF (IORESULT <> 0) THEN
                                                              BEGIN
                                                                        WRITELN 
('Can''t open .ASW file');
                               {Error Message Here}
     HALT; {or Exit, ..  or whatever.. you don't have to Halt Everytime,
             but usually most of the time if the error occurs, you can't
                                                                        proceed 
with the rest of the program so you might as well
                                                 halt}
                                                           END;
                                                                 READLN (ASWFile
, Name);
          READLN (ASWFile, Date);
                                   READLN (ASWFile);
                                                      READLN (ASWFile, Message);
                                                                                 
 CLOSE (ASWFile);
                    IF MESSAGE = '' then
                                           halt else
                                                    END;
                                                        
                                                        { Write Message into MES
SAGE.# File}
            
            PROCEDURE DoIt (NodeNum : BYTE);
VAR
   {$IFDEF OS2}
                 Error : Longint;
                                 {$ELSE}
                                          Error : WORD;
                                                       {$ENDIF}
                                                               BEGIN
                                                                      ASSIGN (MF
ile, StatS.Mu            ltPath + 'MESSAGE.' + itos (NodeNum) );
                                                                  {$I-}
                                                                         RESET (
MFile, 1); {$I+}
                  {That MFile,1 thing has to be on both}
  IF (IORESULT <> 0) THEN      {the RESET and REWRITE commands}
                                                                    BEGIN
                                                                              {$
I-}
        REWRITE (MFile, 1); {$I+}
                                      IF (IORESULT <> 0) THEN
                                                                     BEGIN
                                                                                 W
RITELN ('Unable t         o Modify MESSAGE.' + itos (NodeNum) + '!!');
                                                                              HA
LT;
        END;
                 END;
                       SEEK (MFile, FILESIZE (MFile) ); {I forgot to Seek to the
 End of the File First}
                         {RG Already Appends it's Own %PA to Each Message}
                                                                            BLOC
KWRITE (MFile, TotalMsg,       SUCC (LENGTH (TotalMsg) ), Error);
                                                                   {Needs to be 
total mess               age, including [0] index byte}
                                                         CLOSE (MFile);
                                                                       END;

(*************************************************************************)
                                                                           
                                                                           PROCE
DURE DoItNow;
             VAR
                  I : INTEGER;
                              BEGIN
                                     ASSIGN (Stat, 'RENEGADE.DAT');
                                                                     {$I-}
                                                                            RESE
T (Stat); {$I+}
                 IF (IORESULT <> 0) THEN
     BEGIN
               lpipe ('RENEGADE.DAT not found. Read the dam docs.');
                                                                         writeln
;
      HALT;
                END;
  READ (Stat, StatS);
                       CLOSE (Stat);
                                      ASSIGN (Node, StatS.MultPath + 'MULTNODE.D
AT');
       {$I-}
              RESET (Node); {$I+}
  IF (IORESULT <> 0) THEN
                              BEGIN
                                        {Error Message Here}
     HALT;
               END;
                     FileRead;
                                DELETE (Name, 1, 6);
  DELETE (Message, 1, 7);
                           TotalMsg := '' + Name + ' '+line+' (RGCast/2 v'+versi
on+'):%lf*' + Messag                                                       e;
                                                                               {
The #7 and LF will be put on after it is displayed to y   ou.  This
                                                                       way you c
an see how the message should look to              the user as well.
                                                                        That's w
hy I changed to PWriteln (chang            e to your equivalent).   }
                                                                       writeln;
                                                                               {
  lpipe (TotalM sg+' ');}
                           TotalMsg := #7 + TotalMsg + '%LF';
                                                             {  WRITE (FILESIZE 
(Node), '  Nodes');}
                      writeln;
                                I := 0; {Records are 0 based}
                                                               WHILE NOT EOF (No
de) DO
              BEGIN
                           SEEK (Node, I);
                                                  READ (Node, NodeS);
                                                                     IF (NodeS.U
ser > 0) THEN
                        DoIt (SUCC (I) ); { Succ(I) = (I + 1); }
                                                                        {Since N
odes are 1 based and records are 0 based                , needed to use
                                                                             suc
cessor of I}
                    INC (I);
        END;
              ASSIGN (ASWFile, StatS.MiscPath + 'RGCST' + PARAMSTR (1) + '.ASW')
;
 {  ASSIGN (ASWFile, StatS.MiscPath + 'RGCAST.ASW');}
                                                       ERASE (ASWFile);
                                                                         REWRITE
 (ASWFile);
             CLOSE (ASWFile);
                             END;
                                 
                                 
                                 BEGIN
                                        filemode := $42;
                                                          IF PARAMCOUNT <> 1 THE
N
      BEGIN
           
     CLRSCR;
                 lpipe (' %% RGCast/2  ' + Version + ' os/2 (c) Copyright 1998 b
y Dream Master!DoRE %%');
                         writeln;
                                      lpipe ('──────────────────────────────────
───────                                               ──────────────────────────
────');
            writeln;
                         lpipe ('Doh not the right parameters');writeln;
                                                                             lpip
e ('Please read the DOCS.');writeln;
                                         HALT;
                                              END ELSE
                                                        CLRSCR;
                                                                 cfgread;
                                                                           write
ln;
     lpipe(' %% RGCast/2  v' + Version + ' os/2(c) Co  pyright 1998 by Dream Mas
ter!DoRE %%');
                writeln;
  lpipe ('──────────────────────────────────────────────────────────────────────
─');
      writeln;
                DoItNow;
                        END.
                            
  |08 .|05·|13∙|15Dr|07e|08am Ma|07st|15er|13∙|05·|08.
                                                        |08 °∙|05·|13∙°         |
13°∙|05·|08∙°
               |11 DoRE|03!|11ACiDiC|03!|11Demonic
|08[|15dreamland|09.|15darktech|09.|15org|08]
                                             
--- Mystic BBS v1.12 A36 2017/12/01 (Windows/64)
 * Origin: --[!dreamland BBS dreamland.darktech.org (44:100/0)

Previous Message       Next Message