%option "-nocheck-nodiag-nostack"
%include "nmouse.inc"
%externalroutinespec openappend(%integer s,%string(255)f)
%externalroutinespec openmodify(%integer s,%string(255)f)
%externalintegerfnspec output file size

%begin

%routine show
  %on 3,9 %start
    newline
    closeinput %andreturnif event_event=9
    printstring(event_message); newline
    %return
  %finish
  openinput(1,"pub:test1")
  %cycle; printsymbol(readsymbol); %repeat
%end

becomeprocess(5000)

openoutput(1,":")
openoutput(1,"pub:test1")
printstring("1111111111111111111 this is test1"); newline; closeoutput
show
openmodify(1,"pub:test1")
printstring("(modified)"); newline; setoutput(output file size); closeoutput
show
openappend(1,"pub:test1")
printstring("aaaaaaaaaaaaaaaaaaa this is appended"); newline; closeoutput
show

%end
