MathGroup Archive 2007

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

Search the Archive

Re: problems with delayed write: tag list


P_ter wrote:
> Hello,
> I have a list of elements of two numbers:myList = {{1,2},{2,7},..}. The first number is in this case always the position. I want to know when the difference is a certain value,myDiff, eg. 5
> i=1;myDiff==5;
> now= Reap[While[i<Length[myList],i++;
>        If[myList[[i,2]]-myList[[i,1]]==myDiff,Sow[i]]];w]
> My question is: how do I make "nowFunction[myDiff_]:="? 
> I run into tag list errors in the definition when I try that.
> P_ter
> 
Perhaps this would be clearer if you either

a) Gave us a few samples of input and the corresponding output

or

b) Supply some complete code that fails.

Note also that on line 1 you have written myDiff==5, where you 
presumably meant myDiff=5 .

David Bailey
http://www.dbaileyconsultancy.co.uk


  • Prev by Date: Re: Beta function, Integral
  • Next by Date: FindRoot migration question
  • Previous by thread: Re: problems with delayed write: tag list
  • Next by thread: Re: problems with delayed write: tag list