Hi,
I have changed the code and it now looks like below :
if (win.exename(mycliphan)=="POWERPRO")do
mycaption=win.caption(window("firstwindow", "c=POWERPRONOTE" && "CMS"))
for (i=len;i<0;i--)
if (find(v[i],"COMPLETED") > -1)
v.delete(v[i])
endfor
clip.set(v)
wait.for (100)
endif
============================================
Just to make sure, that I am doing this right.
if (win.exename(mycliphan)=="POWERPRO")do
mycaption=win.caption(window("firstwindow", "c=POWERPRONOTE" && "CMS"))
This line should be triggered when the clip is captured on a powerpronote with
the title "CMS". Is this correct ?
In the for-end loop I am not getting an error message any more.
After the for-end loop has been finished, the vector (v) should now only
contain lines without the word "COMPLETED" in any line.
clip.set (v) should now put the updated vector into the clipboard, so that
pasting with "ctrl-v" should output the revised vector line by line without any
lines containing "COMPLETED".
However.... this is not happening.
I am only getting the following :
"v1"
What went wrong ?
Please advise.
--- In [email protected], "Sheri" <sheri...@...> wrote:
>
> --- In [email protected], "Sheri" <sherip99@> 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--)
>