home *** CD-ROM | disk | FTP | other *** search
/ Network CD 2 / Network CD - Volume 2.iso / programs / dopus / arexx_scripts / dopusutils / rexx / ports.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1991-10-14  |  696 b   |  31 lines

  1. /* 
  2.  *      Port display program by John Crookshank
  3.  * 
  4.  *      Shows all active ports and sorts into a neat display.
  5.  */
  6.  
  7. names = SHOW(ports)
  8. count = 0
  9. pad = '                         '
  10. lf = '0a'x
  11.  
  12. do while names ~= ""
  13.    count = count + 1
  14.    parse var names name.count " " names
  15.    l = length(name.count)
  16.    name.count = name.count||left(pad,(25-l))
  17. end
  18.  
  19. say lf lf pad'Listing of' count 'active ports:'
  20. say pad '--------------------------'lf lf
  21.  
  22. counter = 1
  23. do until counter > count
  24.    secname = counter + 1
  25.    third = counter + 2
  26.    if secname > count then name.secname = ' '
  27.    if third > count then name.third = ' '
  28.    say name.counter||name.secname||name.third
  29.    counter = counter + 3
  30. end
  31.