#include "SysUser.h"

#include <link/io.h>

void Print_Users(void)
{
   long a;
   int  screenpos;
   int  moreon;
   int  b;

   AFPrintf(NULL,sout,SA[2081]);
   Draw_Line(UserDat.Screen_Width);
   screenpos = 2;
   moreon    = UserDat.More_Flag;

   for(a=0; a<NumUsers; a = a + 3)
   {
      AFPrintf(NULL,sout,SA[2082],(users+a)->name);
     
      if (a+1<NumUsers)
         AFPrintf(NULL,sout,SA[2083],(users+a+1)->name);      
     
      if (a+2<NumUsers)
         AFPrintf(NULL,sout,SA[2083],(users+a+2)->name);      
     
      AFPrintf(NULL,sout,"\n");
      screenpos++;

      if (screenpos==UserDat.Screen_Len && moreon)
      {
         b = More(sout, UserDat.Ansi_Flag, 1);
         
         if (b==1)
         {
            AFPrintf(NULL,sout,"\n");
            break;
         }
         
         if (b==0)
            screenpos=1;
         
         if (b==2)
            moreon=0;
      }

      if (ReadChar(0) == 3)
      {
         AFPrintf(NULL,sout,SA[2084]);
         break;
      }
   }

   Draw_Line(UserDat.Screen_Width);
   AFPrintf(NULL,sout,SA[2085],NumUsers);
   Pause();
}


