I think you missed the point that UV (and it's kin) do *not* compare all 
strings numerically if possible.
It entirely depends on which operation you try to use.
That was the example I gave where all the strings are numerically identical and 
yet the equal test fails.

-----Original Message-----
From: Charles Stevenson <stevenson.c...@gmail.com>
To: U2 Users List <u2-users@listserver.u2ug.org>
Sent: Tue, Jul 24, 2012 6:21 am
Subject: Re: [U2] Comparing Two Dyamic Arrays

Mike meant  NES( ),  not  EQS( ).
nd SUMMATION( ),  not SUM( ).
UM( ) won't yield a scalar unless all delimiters are the same.
       ResultArray =  NES(Array1, Array2)
      If summation(ResultArray)=0 then samething = true else samething 
Which is all well and good . . . as long as you consider "7" = "7.00" = 
007" = " 7."
To address Bill Brutzman's original question:
The trouble is that we don't _declare_ variables in UV/UD/MV Basic as 
trings or integer, etc.
o UV & its kin makes a best guess.
V (& kin? There may be some variance!)  will attempt to compare EQ, NE, 
T, & their ilk the two vars numerically, if possible.
hat's what happens with my "seven" example above.  All those strings 
re treated as equal numerically.
he related multivalue handling functions, .e.g, EQS, do the same, piece 
y piece.
If one of the two vars can't be treated numerically, then it compares as 
This is probably as good a general solution as any using "EQ":
       if  len(Array1) EQ len( Array2 )  then       ; * because len( )  
s so very fast
         * non-numeric 'x' concatenation forces the 2 to be treated as 
         samething = ( ( 'x': Array1 ) EQ ( 'x': Array2 ) )
      end else
         samething = @false
i don't know how the speed compares to COMPARE(), which is simpler to read.
-- Chuck

n 7/23/2012 3:46 PM, Bill Haskett wrote:
 I'm not sure this would work, as the UniData documentation for "EQS" 

 The UniBasic EQS function compares each value in array1 to its 
 value in array2. UniData returns an array with 1 in each position 
 where values are
 equal, and 0 in each position for values that are not equal.

 Thus, if the following...

 ARRAY1 = '11':@VM:'12':@VM:'13':@VM:'20':@VM:'21'
 ARRAY2 = '11':@VM:'12':@VM:'13':@VM:'19':@VM:'22'

 ...then the resultant ARRAY3 would look like:


 On the other hand, the following...

 ARRAY1 = '11':@VM:'12':@VM:'13':@VM:'20':@VM:'21'
 ARRAY2 = '11':@VM:'12':@VM:'13':@VM:'20':@VM:'21'

 ...would assign ARRAY3 to look like:




 ...would equal 5, which would only indicate equality if


 Does this make sense?  With mixed @AMs & @VMs I suspect one would have 
 to loop through the result array comparing.

 Is UniData different than UniVerse?


 ----- Original Message -----
 *From:* mfarr...@premdor.com
 *To:* U2 Users List <u2-users@listserver.u2ug.org>
 *Date:* 7/23/2012 1:17 PM
 *Subject:* Re: [U2] Comparing Two Dyamic Arrays
> Try:
> ResultArray =  EQS(Array1, Array2)
> If sum(ResultArray)=0 then samething = true else samething = false
2-Users mailing list

U2-Users mailing list

Reply via email to