Worked it out Herman... using BarIndex() is the way to do it... Thanks
--- In amibroker@yahoogroups.com, "Rob" <sidharth...@...> wrote: > > Yeah I thought of that Herman... problem is I don't know if that element > where the 4 was will actually contain a 4 or another number... could contain > a 6 or an 8... etc > > Ummm... maybe I'm looking only at a looping solution. > > I hate looping. > > --- In amibroker@yahoogroups.com, Herman <psytek@> wrote: > > > > Perhaps something along this line (untested). Note you look forward > > from array2, if it finds a 4 four places ahead you substitute a > > newvalue > > > > Array2 = iif( ref( array1), 4) == 4, newvalue, Array2); > > > > herman > > > > > Hi All, > > > > > I seem to have a hit a logic block... not sure why. > > > Let's say I have the following array, > > > > > 0 0 0 0 0 0 0 0 4 0 0 0 0 0 > > > > > Now, lets say when I see the number 4, I want to change the value > > > in another array 4 elements back (yes, the number relates to the > > > number of elements back I want to change in another array)... > > > > > So, the other array goes from all zeros, to... > > > > > 0 0 0 0 1 0 0 0 0 0 0 0 0 0 > > > > > I realize I can do this with looping... is there a simple way to do with > > > AFL...? (i.e. not looping) > > > > > TIA > > > > > > > > > ------------------------------------ > > > > > **** IMPORTANT PLEASE READ **** > > > This group is for the discussion between users only. > > > This is *NOT* technical support channel. > > > > > TO GET TECHNICAL SUPPORT send an e-mail directly to > > > SUPPORT {at} amibroker.com > > > > > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at > > > http://www.amibroker.com/feedback/ > > > (submissions sent via other channels won't be considered) > > > > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > > > http://www.amibroker.com/devlog/ > > > > > Yahoo! Groups Links > > >