! Macro used to test the graphical performance of LIST.
!
! This macro will open a file and then add lines to it at a given interval.
! This allows measurement tools to be attached to measure the graphical
! performance of LIST. (All such measurements would be made using a third-
! party tool -- this macro does not measure anything directly.)
!
! A sample usage of this is to monitor the X11 traffic (with a tool such
! as ethereal) that results from the LIST being forwarded from a display
! server to a remote terminal.
!
! @author  J. Czechowski IV
! @since   NeXtMidas 2.1.0
!
startmacro

  call setDatDir

  set file    ^{datDir}.testxy3000         ! The file to initially list
  set tab     {absc=1,ord=2,ord2=3,ord3=4}  ! The row of data to add
  set counter 50                            ! number of lines to add
  set delay   1                             ! delay between adding rows (sec)


  list/bg/id=mylist ^file

  while counter gt 0
    invoke junk reg.mylist.gs.addRow(tab)  
    pause ^delay
    calc counter counter 1 -
  endwhile

  message send mylist ,, EXIT

endmacro

!******************************************************************************!
! Set the dat directory
!******************************************************************************!
procedure setDatDir
  invoke nxmMajor env.nmversion.subString(0,1)
  invoke major java.lang.Integer.valueOf(nxmMajor)
  if major GE 4 then
    invoke s:datDir           nxm.sys.test.DatLocator.getDatDirLocation()
    invoke s:datDirSlash      nxm.sys.test.DatLocator.getDatDirSlashLocation()
    invoke z:sysDatFull       nxm.sys.test.DatLocator.sysDatFull()
    invoke z:sysTestDatExists nxm.sys.test.DatLocator.sysTestDatExists()
  else
    set s:datDir           "nxm.sys.dat"
    set s:datDirSlash      "nxm/sys/dat"
    set z:sysDatFull       true
    set z:sysTestDatExists false
  endif
return
