
function OnMXPError (level, number, line, message)
  if level = "W" then 
    world.NoteColourName "white", "red"
    world.Note level + "(" + cstr (number) + ")[ " + cstr(line) + "]: " + message
  end if

' world.colornote "red", "gray", message

 if number = 20001 then 	OnMXPError = 1

end function

function OnMXPStartTag (name, args, mylist)

  dim i

  world.AppendToNotepad "MXP", "Opening tag: " + name + vbCRLF
  world.AppendToNotepad "MXP", "Argument list: " + args + vbCRLF

  if not IsEmpty (mylist) then
    for i = lbound (mylist) to ubound (mylist)
      world.AppendToNotepad "MXP", "Arg " + cstr (i) + " = " + mylist (i) + vbCRLF
  next
  End If

  if name = "p" then world.note "Start tag = " + name
  if name = "rdesc" then OnMXPStartTag = 1

end function

sub OnMXPvariable (name, contents)

world.note "Var " + name + " set to " + contents

end sub

sub OnMXPEndTag (name, text)

  world.AppendToNotepad "MXP", _
       "Closing tag: " + name + vbCRLF
  world.AppendToNotepad "MXP", _
       "Text: " + text + vbCRLF
end sub

