How to stop execution of macro in interactive session

Hi,
Is there a way to stop executing a macro and in the same time remain in the
interactive session. For example:[code]
// macro.C:
Int_t
foo (Int_t l)
{
if (!l) // Stop executing macro and return to prompt

}

void
haha ()
{
Int_t hihi = foo (0);

}
[/code]

So ok this thing can be done with the try / catch thing:

class error
{
};

Int_t
foo (Int_t l)
{
  if (!l) {
    throw error ();
  }
  ...
}

void
haha ()
{
  try
    {
       Int_t hihi  = foo (0);
    }
  catch (error)
    {
      return;
    }
    ...
}

or something like this but is there more general way?

The throw/try/catch mechanism should work.

I do no understand what you are exactly asking. A macro is interrupted and returns to the interactive prompt has soon as it returns (either via return or via an exception). as any C++ functions.

Cheers,
Philippe.

Yes this was stupid question :laughing: forget it :smiley: