Re: Newbie question. Difficulty understanding a few things.

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu