

macro UseBuffer(buf,le)
{
  string buf=nuls le
  sys buf##o=0
  sys buf##l=le
  sys buf##ls
  '
  macro append(buf,s)
  {
  buf##ls=len s
  if buf##ls+buf##o>buf##l then
    buf+=nuls buf##l+buf##ls
    buf##l=len buf
  end if
  mid buf,buf##o+1,s
  buf##o+=buf##ls
  }
  '
  macro content(buf)
  {
  left buf,buf##o
  }
  '
  macro clear(buf)
  {
  buf##o=0
  }
}


UseBuffer prlist,100
append prlist, "one"+cr
append prlist, "two"+cr
append prlist, "three"+cr
print content prlist
clear prlist
'print content prlist


