MathGroup Archive 2002

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

Search the Archive

How to Return from within a Table[]-Command?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg33728] How to Return from within a Table[]-Command?
  • From: Detlef Mueller <dmueller at mathematik.uni-kassel.de>
  • Date: Wed, 10 Apr 2002 00:49:10 -0400 (EDT)
  • Organization: University of Kassel - Germany
  • Sender: owner-wri-mathgroup at wolfram.com

Hello,

I wanted to scan trough al List, building a new
List, but aborting, if one Element of the first
List violates a special Condition ... 
say for example:

Divide2[L_List] := Module[{},
    Table[
      If[IntegerQ[L[[i]]],
        i/2, 
        Return["vector not valid."];
        ]
      , {i, 1, Length[L]}
      ]

    ...

    ]

But this results:

In[13]:= Divide2[{2,3,a}]
Out[13]= {1/2, 1, Return["vector not valid."]}

Wich is of course not what I want.

Greetings

  Detlef


  • Prev by Date: Re: Bayesian?
  • Next by Date: "math1" and "math4" font conversion problem
  • Previous by thread: RE: How to specify a parameter
  • Next by thread: Re: How to Return from within a Table[]-Command?