Witango-Talk: array different

2002-12-14 Thread Brad J. Robertson



Hello,
 
Is there a metatag that takes 2 arrays and creates 
an array of the records that don't appear in either array?  A reverse 
@union.  
 
Tango2000
IIS 5
Win2000
SQL 7
 
Brad


RE: Witango-Talk: array different

2002-12-14 Thread David Shelley



Brad,
 
If you 
really want stuff that doesn't appear in either array, <@random> will 
usually work. :)
 
If you 
want elements from one array that are not in the other array you can use 
<@filter>.
<@filter array=array1 expr="!(@@array2 contains #1)">  (this 
assumes both arrays have 1 column )
 
If you 
want elements from either array that are not in both arrays, you can use the 
above <@filter> twice and add the results 
together. 

<@assign local$array3 <@filter array=array1 expr="!(@@array2 contains 
#1)">>

<@addrows array=local$array3 value=<@filter 
array=array2 expr="!(@@array1 contains 
#1)">>
 
Unfortunately the server will throw an error processing 
empty arrays, so you may want to test for empty before using <@filter> or 
<@addrows>.
 
Dave Shelley.
[EMAIL PROTECTED]
 -Original Message-From: 
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On 
Behalf Of Brad J. RobertsonSent: Saturday, December 14, 2002 4:41 
PMTo: Multiple recipients of list witango-talkSubject: 
Witango-Talk: array different

  Hello,
   
  Is there a metatag that takes 2 arrays and 
  creates an array of the records that don't appear in either array?  A 
  reverse @union.  
   
  Tango2000
  IIS 5
  Win2000
  SQL 7
   
  Brad


Re: Witango-Talk: array different

2002-12-14 Thread Brad J. Robertson



Awesome thanks - I am suffering weekend brain 
damage.

  - Original Message - 
  From: 
  David 
  Shelley 
  To: Multiple recipients of list 
  witango-talk 
  Sent: Saturday, December 14, 2002 3:54 
  PM
  Subject: RE: Witango-Talk: array 
  different
  
  Brad,
   
  If 
  you really want stuff that doesn't appear in either array, <@random> 
  will usually work. :)
   
  If 
  you want elements from one array that are not in the other array you can use 
  <@filter>.
  <@filter array=array1 expr="!(@@array2 contains #1)">  (this 
  assumes both arrays have 1 column )
   
  If 
  you want elements from either array that are not in both arrays, you can use 
  the above <@filter> twice and add the results 
  together. 
  
  <@assign local$array3 <@filter array=array1 expr="!(@@array2 
  contains #1)">>
  
  <@addrows array=local$array3 value=<@filter 
  array=array2 expr="!(@@array1 contains 
  #1)">>
   
  Unfortunately the server will throw an 
  error processing empty arrays, so you may want to test for empty before using 
  <@filter> or <@addrows>.
   
  Dave Shelley.
  [EMAIL PROTECTED]
   -Original Message-From: 
  [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On 
  Behalf Of Brad J. RobertsonSent: Saturday, December 14, 2002 
  4:41 PMTo: Multiple recipients of list 
  witango-talkSubject: Witango-Talk: array 
  different
  
Hello,
 
Is there a metatag that takes 2 arrays and 
creates an array of the records that don't appear in either array?  A 
reverse @union.  
 
Tango2000
IIS 5
Win2000
SQL 7
 
Brad