SUB raiseexception
  dim s as string
  dim var as NSException
  msgbox "before try"
  try
    s=NSString.stringWithString(nil)	// raise an exception
    msgbox "in try - after exception"
  exception var 
    msgbox ("Exception="+var.name)
  end try
  msgbox "after end try"
  s=NSString.stringWithString(nil)	// and again without catching
  msgbox "after try - after exception"
END SUB