Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8649

Re: Interrupt a block

From Szabolcs Horvát <szhorvat@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Interrupt a block
Date 2012-02-20 07:56 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jhsubb$nq1$1@smc.vnet.net> (permalink)
References <jhqmbg$f5m$1@smc.vnet.net>

Show all headers | View raw


On 2/19/2012 1:27 PM, Sam Takoy wrote:
> Hi,
>
> Is there a command for interrupting a block of code?
>
> For example, if I have a list of 10 commands, but I only want to
> execute the first five?
>

Why do you need to interrupt it?

There's Abort[] for a hard abort

There's Interrupt[] which will interrupt and ask what you want to do

There's Dialog[] that'll give you an interactive subsession at that 
point so you can inspect the kernel state

There's Throw[] for returning (a value) from arbitrarily deep in an 
expression

There's Return[], as well as the undocumented two argument form 
Return[val, fun] which returns from function fun

There's Break[], Continue[], Goto[] ...

As well as others.  Can you explain why and how do you need to interrupt 
the calculation so we can give a more specific answer?

-- 
Szabolcs Horvát
Visit Mathematica.SE:  http://mathematica.stackexchange.com/

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Interrupt a block Sam Takoy <sam.takoy@yahoo.com> - 2012-02-19 11:27 +0000
  Re: Interrupt a block David Bailey <dave@removedbailey.co.uk> - 2012-02-20 07:55 +0000
  Re: Interrupt a block Szabolcs Horvát <szhorvat@gmail.com> - 2012-02-20 07:56 +0000

csiph-web