MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Aborting a computation ...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg93282] Aborting a computation ...
  • From: Ignacio Plazeta <Ignacio.Plazeta at speednet.es>
  • Date: Sun, 2 Nov 2008 01:57:35 -0500 (EST)

Dear friends

There is a conceptual lack in my
understanding of the way to stop
a computation; nor Abort[] neither
Interrupt[] works as I supposed
they do.

The following code prints
"something" when myFolder
exists and when it doesn't.

------------------------------------
myFolder="c\\someFolder";

errorLevel=Catch[

   Off[SetDirectory::"cdir"];
   SetDirectory[myFolder];
   On[SetDirectory::"cdir"];

   If[
     Directory[]!=myFolder,

     Print["Warning: folder non found ..."];
     Throw[0];,

     Throw[1];
   ];
];

If[errorLevel==0,Abort[]];

Print["something"];

------------------------------------

Of course it may be fixed using:

If[errorLevel == 0,

   Abort[];
   Print["something"];

   ];

but, in the long run, the code
became too nested and the questions
about Abort[]/Interrupt[] still hangs.

Warmest regards.
Ignacio

------------------------------------
P.S. You see, I'm not a native
speaking English; I apologize for
my poor lamguage.


  • Prev by Date: Re: How to reverse Enter and Shift-Enter
  • Next by Date: Re: Expressions with ellipsis (...)
  • Previous by thread: Re: Exporting graphics in PDF with fonts embedded
  • Next by thread: Re: Aborting a computation ...