Re: Newbie question. Difficulty understanding a few things.
- Posted by don cole <doncole at p?c?ell.net> May 25, 2008
- 687 views
Rob H. wrote: > > > I understand what seek is doing. However. The seek_positions[element] > determines > where seek is currently "looking" because it's incrementing with the for > element > loop. > So why is the [1] necessary?? Not sure if I'm explaining myself correctly... > In the Reference Manual, seek only takes one argument... I'm wondering what > the [1] and -1 specifically do.
seek_positions = {} for element = 1 to length(string) do if find(string[element],vowels) then seek_positions = append(seek_positions,{element, string[element]}) string[element] = ' ' end if end for
Here we are building a 2 element sequence called seek_positions. the first element being the element number. the second element being a string (' ') in the code seek_positions[1][1]=1 seek_positions[1][2]=' ' seek_postition[2][1]=2 seek_positions[2][2]=' ' etc... so seek_positions[2][1]-1=1 seek_positions[5][1]-3=2 Don Cole