anchor.diff:    after 2000 -> timeout
     end.
   
  -%append(Pid, Line) ->
  -%  sendRecv(Pid, append, Line).
  -
  -delete(Pid) ->
  -  sendRecv(Pid, delete).
  -
  -list(Pid) ->
  -  sendRecv(Pid, list).
  -
  -print(Pid) ->
  -  sendRecv(Pid, print).
  -
  -lineCount(Pid) ->
  -  sendRecv(Pid, lineCount).
  -
  -setLineNumber(Pid, Num) ->
  -  sendRecv(Pid, setLineNumber, Num).
  -
  -
   append(Pid) ->
     L = io:get_line(""),
     case L of
  
positive.code:   try erlang:list_to_integer(String) catch error:_Ex -> 0 end.
  
  numValid(E, Num) ->
    (Num > 0) and (Num =< lineCount(E)).
  
  getcmd(E) ->
    L = chomp(io:get_line(prompt())),
  
negative.code:     "q" -> {quit, E};
      "a" -> append(E),
             getcmd(E);
      ",p" -> io:format("~s", [sendRecv(E, list)]),
              getcmd(E);
      "p" -> io:format("~s", [sendRecv(E, print)]),
             getcmd(E);
      "d" -> sendRecv(E, delete),
             getcmd(E);
      _ -> Num = getnum(L),
           NumValid = numValid(E, Num),
           if NumValid ->
                sendRecv(E, setLineNumber, Num),
                getcmd(E);
              true ->
                unknown(),
  