MathGroup Archive 2012

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

Search the Archive

Re: Using Throw/Catch in MeshFunctions doesn't work? (8.0.4)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg125362] Re: Using Throw/Catch in MeshFunctions doesn't work? (8.0.4)
  • From: bradc355113 at yahoo.com
  • Date: Fri, 9 Mar 2012 06:09:59 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jj9uld$dqp$1@smc.vnet.net>

Oops, the Goto/Label workaround that I described previously doesn't actually seem to work either. I get a "Label not found" error. Again, this only happens when used in the MeshFunctions option. In other scenarios the Goto/Label work fine.

Here's a simple example that generates the Goto::nolabel error:

Plot3D[x^2 + y^2, {x, -1, 1}, {y, -1, 1}, MeshFunctions -> {(Goto[tag]; Label[tag]; #1 #2) &}]

My workaround now is to use nested If statements like this:

f[...] := Module[
    {ret},
    DoStepA[];
    If[StepAFailed[],
        Message[...]; ret = $Failed,
        (* else success so far *)
        DoStepB[];
        If[StepBFailed[],
            Message[...]; ret = $Failed,
            (* else success so far *)
            ...
            ret = DoFinalCalculation[]
        ]
    ];
    ret
]

Plot3D[..., MeshFunctions -> {f[#1, #2] &}]



  • Prev by Date: Dynamically create Select criteria
  • Next by Date: possible an error in Mathematica or a book proof
  • Previous by thread: Using Throw/Catch in MeshFunctions doesn't work? (8.0.4)
  • Next by thread: Finding Converging Function