home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / opus / opin103d.lzh / D_NODEL.PAS < prev    next >
Pascal/Delphi Source File  |  1989-12-03  |  3KB  |  89 lines

  1. Program DemoNodelist;
  2.  
  3.   {***************************************************************************}
  4.   {*                                                                         *}
  5.   {* O p u s   I n t e r f a c e    V e r   1.03     Demo Program.           *}
  6.   {*                                                                         *}
  7.   {*   Opus V 1.0x Interface for Turbo Pascal Ver 4.0, 5.0 and 5.5           *}
  8.   {*                                                                         *}
  9.   {*  These Structures,Procedures and Functions may help you to make OPUS    *}
  10.   {* utilities for to help other SysOps, Please read the Documentation.      *}
  11.   {*                                                                         *}
  12.   {*  Regards                                                                *}
  13.   {*    Per Holm                                                             *}
  14.   {*                                                                         *}
  15.   {*   FIDO: Per Holm - Asgaard BBS 2:230/22.0                               *}
  16.   {*   UUCP: perholm@daimi.DK                                                *}
  17.   {*                                                                         *}
  18.   {***************************************************************************}
  19.  
  20.   {***************************************************************************}
  21.   {*                                                                         *}
  22.   {*  Demo of the nodelist related routines...                               *}
  23.   {*                                                                         *}
  24.   {***************************************************************************}
  25.  
  26. Uses
  27.   OpInt;
  28.  
  29. PROCEDURE ChkError;
  30.  
  31.   VAR
  32.     Err: Integer;
  33.  
  34.   BEGIN
  35.     Err:=OpIntERROR;
  36.     IF Err>0 THEN
  37.       BEGIN
  38.         Writeln('You Got Yourself an Error ',Err,' During OpInt Access');
  39.         Readln;
  40.       END;
  41.   END;
  42.  
  43. PROCEDURE ChkNode5;
  44.  
  45.   VAR
  46.     l: LongInt;
  47.     N:_Node;
  48.  
  49.   BEGIN
  50.     l:=FindNode('Nodelist.Idx',230,22);    { Find last entry for node 230/22 }
  51.     ChkError;
  52.     ReadNode('Nodelist.Sys',N,l);          { Read the information }
  53.     ChkError;
  54.     Writeln('BoardName .... : ',N.Name);
  55.     Writeln('Phone ........ : ',N.Phone);
  56.     Writeln('Password ..... : ',N.Password);
  57.     N.Password:='YOYO';                    { Change the password }
  58.     WriteNode('Nodelist.Sys',N,l);         { Update the nodelist }
  59.     ChkError;
  60.   END;
  61.  
  62. PROCEDURE ChkNode6;
  63.  
  64.   VAR
  65.     l: LongInt;
  66.     N:_NewNode;
  67.  
  68.   BEGIN
  69.     l:=NumberOfNodes('Nodelist.Idx');     { Get the numbers of nodes in the NL}
  70.     ChkError;
  71.     ReadNewNode('Nodelist.Dat',N,l);      { Read the last record in the NL }
  72.     ChkError;
  73.     Writeln('BoardName .... : ',N.Name);
  74.     Writeln('Phone ........ : ',N.Phone);
  75.     Writeln('Password ..... : ',N.Password);
  76.     N.Password:='NONO';
  77.     N.Number:=9999;
  78.     WriteNewNode('Nodelist.sys',N,l+1);   { Add a new record to the nodelist }
  79.     ChkError;
  80.   END;
  81.  
  82. BEGIN
  83.   ChkNode5;
  84.   ReadLn;
  85.   ChkNode6;
  86.   readln;
  87. END.
  88.  
  89.