C Collection of code snippets by Arne Vajhøj 
C (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
      program p2
      call test('0::"task=s0task"')
      call test('0::"task=s1task"')
      call test('0::"task=s2task"')
      call test('0::"task=s3task"')
      call test('0::"task=s4task"')
      call test('0::"task=s5task"')
      call test('0::"task=s6task"')
      call test('0::"task=s7task"')
      call test('0::"task=s8task"')
      end
c
      subroutine test(task)
      character*(*) task
      integer*4 msglen
      character*1000 msg
c  silly hack to avoid breaking lines over 80 characters
      open(unit=6,file='sys$output',status='new',recl=132)
c  open task
      open(unit=1,file=task,status='old')
c  read message from task
      read(unit=1,fmt='(q,a)') msglen,msg
c  print
      write(unit=6,fmt='(A)') '|'//msg(1:msglen)//'|'
c  close task
      close(unit=1)
      return
      end
