--- In [email protected], "Sheri" <sheri...@...> wrote:
>
> --- In [email protected], "lakeshoresurfer" <camicello@> wrote:
> >
> > Hi all,
> > 
> > I have created a vector using :
> > 
> > 
> > win.resetfocus()
> > local mycaption
> > local myclip    = clip.get
> > local mycliphan = win.getfocus
> > local v         = vec.createFromLines(myclip)
> > local i
> > local len   = v.length
> > 
> > ;  Check if clip taken on PowerProNote
> > ;  ************************************
> > 
> > if (win.exename(mycliphan)=="POWERPRO" and )do
> >    mycaption=win.caption(window("firstwindow", "c=POWERPRONOTE && CMS"))
> > 
> > for (i=0;len;i++) 
> > 
> >    if (find(v[i],"COMPLETED") > -1)
> >    v.delete(v[i])
> > 
> > endfor
> > 
> > endif
> > 
> > 
> > This is supposed to capture the content from a powerpro note and
> > put it line by line in a vector.
> > 
> > Then each line is supposed to be checked if the word "COMPLETED"
> > is found, and if so remove that line from the vector.
> > 
> > But some I get an index error.
> > 
> > Any idea what I am doing wrong ?
> > 
> > Thanks for any assistance.
> >
> 
> You should be working backward starting with the last index in the vector, 
> because as soon as you delete one, the latter items in the vector are 
> reindexed.
> 
> E.g., for (i=len,0,i--)
> 

make that: for (i=len; i<0 ; i--)


Reply via email to