MathGroup Archive 1996

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

Search the Archive

Re: Re; Goto Limits

  • Subject: [mg3101] Re: [mg3090] Re; Goto Limits
  • From: jesroj at wmatem.eis.uva.es (Jesus ROJO)
  • Date: 1 Feb 1996 05:29:17 -0600
  • Approved: usenet@wri.com
  • Distribution: local
  • Newsgroups: wri.mathgroup
  • Organization: Wolfram Research, Inc.
  • Sender: daemon at wri.com

Your message:
> 
> 	Hi, am trying to operate a Goto[label] inside a If[] conditional
> does anyone know what the limits of this command are? I cannot seem to 
> get the Goto[] to work as a conditional of If[]. Is there a better way 
> of estabishing a loop that has a exit condition and a loop condition?
> Thanks for the help.
> Andre
> 

Hello, 

A example of the way of run the obstacle 
with Goto-If-Label is the next

(* begin of example *)
(* start of loop *)

noposiblepivote=0;
For[
   k=2,
   k=!=n&&noposiblepivote==0,
   k++,
      ....................
  pivote=0.; npivote=k;
  Do[
    If[pivote<Abs[Pivote[[i]]],pivote=Abs[Pivote[[i]]];npivote=i,]
  ,{i,k,n}];
  If[pivote<10^(-20),noposiblepivote=1];
      ....................
];

(* after the loop *)

If[noposiblepivote==1,Goto[noposibleconpivote]];
If[noposiblepivote==2,Goto[noposiblesinpivote]];
      ....................
Label[noposibleconpivote];
      ....................

(* end of example *)

I hope this help,
			  Jesus ROJO

--
---------------------------------------
|  Jesus ROJO                         |
|  Dpto. de Matematica Aplicada       |
|  E.T.S. de Ingenieros Industriales  |
|  Paseo del Cauce s/n                |
|  47011 VALLADOLID, Spain            |
|  Phone : 34 - 83 - 42 33 90         |
|  Fax   : 34 - 83 - 42 34 06         |
|  e-mail: jesroj at wmatem.eis.uva.es   |
---------------------------------------


  • Prev by Date: Re: Re; Goto Limits
  • Next by Date: Why printing in Courier font only?
  • Previous by thread: Re: Re; Goto Limits
  • Next by thread: Why printing in Courier font only?