filter command

Marco Sch=?ISO-8859-1?B?9g==?=nenberger moeb at swissonline.ch
Thu Apr 11 05:14:25 EDT 2002


You may also have a look at the intersect command

on mouseup
  put filterfields (fld 1, fld 2) into fld 3
end mouseup


FUNCTION filterfields vFeld1, vFeld2
  --step 1: convert fields into arrays
  --step 2: use the content of the field lines as keys of the array
  --step 3: intersect both arrays, the keys common to both arrays remain
  --Since I'm lazy, I'm using the replace command to prepare
   --the fields for the conversion into an array
  if last char of vFeld1 <> return then put return after vFELD1
  replace return with tab & return in vFeld1
  split vFeld1 with return and tab
  if last char of vFeld1 <> return then put return after vFELD2
  replace return with tab & return in vFeld2
  split vFeld2 with return and tab
  intersect vFeld1  with vFeld2
  return the keys of vFeld1
end filterfields

> ----- Original Message -----
> From: yves COPPE <yvescoppe at skynet.be>
> To: <use-revolution at lists.runrev.com>
> Sent: Wednesday, April 10, 2002 3:05 PM
> Subject: filter command
>
>
> > Hello,
> >
> >
> > I have two flds. There are list flds.
> > I'd like to put in a variable the lines which are common to the two flds
> >
> > example
> >
> > Fld 1
> >
> > one
> > three
> > five
> >
> >
> > Fld 2
> >
> > One
> > two
> > three
> > four
> >
> >
> > the variable must contain :
> >
> > one
> > three
> >
> > How to proceed ?
> >
> >
> > thanks.
> > --
> > Greetings.
> >
> > Yves COPPE
> >
> > Email : yvescoppe at skynet.be
> > _______________________________________________
> > use-revolution mailing list
> > use-revolution at lists.runrev.com
> > http://lists.runrev.com/mailman/listinfo/use-revolution
>
>




More information about the use-livecode mailing list