%externalroutine tcpanal(%string(255) s) %constant %integer maxtcps=27 %constant %string(15) %array tcpname(1:maxtcps)="TCPA","TCPC","TCPD","TCPM","JCMB", "G.SQ.","EULIB","SOCS","ATB-1","ATB-2","ATB-3","CS-AT1","CS-AT2","ENGIN","CHEM", "POLLCK","XGATE","TCPS","GEOG","PSSE", "X25","SCRI-I","SCRI-P","FOREST","ERSKIN","WS-COA","null" %integer i,tcpusercount,j %recordformat rf1(%integer n,a) %recordformat pf(%string(6)user,%string(15)tcp,%byteinteger a,invoc,b,n,f, %integer logs,%byteinteger c,d,e,r,%integer id,proc,g,h,z) %record(rf1) r1 %record(pf)%array p(1:256) %externalroutinespec prompt(%string(255) s) %externalintegerfnspec dprocedure(%integer a,b) %on %event 4 %start printstring("You Are Supposed To Type The Number Associated With The Tcp!") newline %stop %finish r1_a=addr(p(1)) i=dprocedure(1,addr(r1)) %if s="?" %start printstring("The Following Tcps Are Currently Supported");newline;newline %for i=1,2,maxtcps %cycle write(i,3);printstring(": ".tcpname(i)); %if i+1<=maxtcps %start write(i+1,15-length(tcpname(i))) printstring(": ".tcpname(i+1)) %finish newline %repeat prompt("TCP-Number?:") read(i) %if (i<1) %or (i>maxtcps) %then printstring("Wrong Number") %and newline %and %stop s=tcpname(i) %finish %if s<>"*" %start tcpusercount=0 %for i=1,1,r1_n %cycle %if p(i)_tcp=s %then tcpusercount=tcpusercount+1 %repeat printstring("Number Of Users On Tcp ".s." Is ") write(tcpusercount,3);newline %finishelsestart %for i=1,1,maxtcps %cycle tcpusercount=0 s=tcpname(i) printstring("Number Of Users On Tcp:".s) %for j=1,1,r1_n %cycle %if p(j)_tcp=s %then tcpusercount=tcpusercount+1 %repeat write(tcpusercount,10-length(s));newline %repeat %finish %end %endoffile