Index: trunk/MagicSoft/Mars/mbase/MContinue.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MContinue.cc	(revision 1668)
+++ trunk/MagicSoft/Mars/mbase/MContinue.cc	(revision 1715)
@@ -24,21 +24,53 @@
 
 /////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MContinue                                                               //
-//                                                                         //
-// Does nothing than return kCONTINUE in the Process-function              //
-// (use with filters)                                                      //
-//                                                                         //
+//
+// MContinue
+//
+// Does nothing than return kCONTINUE in the Process-function
+// (use with filters). For more details see the description of the
+// constructors.
+//
 /////////////////////////////////////////////////////////////////////////////
 #include "MContinue.h"
 
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MF.h"
+#include "MParList.h"
+#include "MTaskList.h"
+
 ClassImp(MContinue);
 
-MContinue::MContinue(const char *name, const char *title)
+// --------------------------------------------------------------------------
+//
+// Use this constructor if a rule (see MF for more details) shell be used.
+// MContinue will create a MF object and use it as a filter for the
+// instance. The MF-Task is added to the tasklist in front of the MContinue
+// instance and also automatically deleted, eg.
+//   MContinue cont("MHillas.fSize<20");
+//   tasklist.AddToList(&cont);
+// would skip all events which fullfill "MHillas.fSize<20" from this point
+// in the tasklist.
+//
+MContinue::MContinue(const TString rule, const char *name, const char *title)
 {
     fName  = name  ? name  : "MContinue";
     fTitle = title ? title : "Task returning kCONTINUE";
+
+    if (rule.IsNull())
+        return;
+
+    SetBit(kIsOwner);
+
+    MTask::SetFilter(new MF(rule, TString("MF(")+fName+")"));
 }
 
+// --------------------------------------------------------------------------
+//
+// Use this if you have a filter. Would be the same as if you would call:
+//   MContinue cont;
+//   cont.SetFilter(f);
+//
 MContinue::MContinue(MFilter *f, const char *name, const char *title)
 {
@@ -48,2 +80,46 @@
     SetFilter(f);
 }
+
+// --------------------------------------------------------------------------
+//
+//  Delete the filter if it was created automatically
+//
+MContinue::~MContinue()
+{
+    if (TestBit(kIsOwner))
+        delete GetFilter();
+}
+
+// --------------------------------------------------------------------------
+//
+//  In case the filter was created automatically, PreProcess tries to find
+//  the tasklist MTaskList, adds the filter before this instance to the
+//  tasklist and preprocesses the filter.
+//
+Bool_t MContinue::PreProcess(MParList *list)
+{
+    if (!TestBit(kIsOwner))
+        return kTRUE;
+
+    MTaskList *tlist = (MTaskList*)list->FindObject("MTaskList");
+    if (!tlist)
+    {
+        *fLog << err << dbginf << "ERROR - Tasklist 'MTaskList' not found... abort." << endl;
+        return kFALSE;
+    }
+
+    if (!GetFilter())
+    {
+        *fLog << err << dbginf << "Unknown fatal Error! (fFilter=NULL?!?)" << endl;
+        return kFALSE;
+    }
+
+    if (!tlist->AddToListBefore(GetFilter(), this))
+    {
+        *fLog << err << dbginf << "ERROR - Adding filter before MContinue... abort." << endl;
+        return kFALSE;
+    }
+
+    return GetFilter()->CallPreProcess(list);
+}
+
Index: trunk/MagicSoft/Mars/mbase/MContinue.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MContinue.h	(revision 1668)
+++ trunk/MagicSoft/Mars/mbase/MContinue.h	(revision 1715)
@@ -20,9 +20,15 @@
 {
 private:
+    Bool_t PreProcess(MParList *list);
     Bool_t Process() { return kCONTINUE; }
 
+    enum { kIsOwner = BIT(14) };
+
 public:
-    MContinue(const char *name=NULL, const char *title=NULL);
+    MContinue(const TString rule="", const char *name=NULL, const char *title=NULL);
     MContinue(MFilter *f, const char *name=NULL, const char *title=NULL);
+    ~MContinue();
+
+    void SetFilter(MFilter *filter) { if (!TestBit(kIsOwner)) MTask::SetFilter(filter); }
 
     ClassDef(MContinue, 1) //Task returning kCONTINUE
Index: trunk/MagicSoft/Mars/mbase/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mbase/Makefile	(revision 1668)
+++ trunk/MagicSoft/Mars/mbase/Makefile	(revision 1715)
@@ -20,5 +20,5 @@
 # @endcode 
 
-INCLUDES = -I. -I../mraw -I../MRawFormat -I../mmc -I../mfileio -I../mmain
+INCLUDES = -I. -I../mraw -I../MRawFormat -I../mmc -I../mfileio -I../mmain -I../mfilter
 
 # @code 
