i have found that if i hash or order a view on the first two columns, and then use 
Find(), it only
works if the row passed to Find was constructed in the same order that the properties 
were given
in the expression passed to GetAs().  there is no problem if the view is not hashed or 
ordered.  i
have not tried any other kind of view.

i am using MK 2.9.4.2 under WinXP.  i tried both the MSVC6 and Intel8 compilers.

here is some code which i added to tmapped.cpp to demonstrate the problem.  there was 
no test of
mapping more than one column already there:

  B (m08, Hash 2 cols and Find using operator +, 0) W (m08a);
  {
    c4_IntProp    p1 ("p1");
    c4_StringProp p2 ("p2");  
    c4_IntProp    p3 ("p3");

    c4_Storage s1 ("m08a", true);
  
    c4_View d1 = s1.GetAs ("d1[p1:I,p2:S,p3:I,p4:B]");
    c4_View m1 = s1.GetAs ("m1[_H:I,_R:I]");
    c4_View h1 = d1.Ordered (2);//.Hash (m1, 2);
  
    h1.Add (p1[1] + p2["one"]   + p3[11]);
    h1.Add (p1[2] + p2["two"]   + p3[22]);
    h1.Add (p1[3] + p2["three"] + p3[33]);
    
    int i = h1.Find (p1[2] + p2["two"]);
    A (i == 1);

    // THIS FAILS:
    int j = h1.Find (p2["two"] + p1[2]);
    A (j == 1);
        
    s1.Commit();

  } D (m08a); R (m08a); E;

  B (m09, Hash 2 cols and Find using C4_Row, 0) W (m09a);
  {
    c4_IntProp    p1 ("p1");
    c4_StringProp p2 ("p2");  
    c4_IntProp    p3 ("p3");

    c4_Storage s1 ("m09a", true);
  
    c4_View d1 = s1.GetAs ("d1[p1:I,p2:S,p3:I,p4:B]");
    c4_View m1 = s1.GetAs ("m1[_H:I,_R:I]");
    c4_View h1 = d1.Ordered (2);//.Hash (m1, 2);
  
    h1.Add (p1[1] + p2["one"]   + p3[11]);
    h1.Add (p1[2] + p2["two"]   + p3[22]);
    h1.Add (p1[3] + p2["three"] + p3[33]);
    
    c4_Row forward;
    p1 (forward) = 2;
    p2 (forward) = "two";
        
    int k = h1.Find (forward);
    A (k == 1);
        
    c4_Row backward;
    p2 (backward) = "two";
    p1 (backward) = 2;
        
    // THIS FAILS:
    int l = h1.Find (backward);
    A (l == 1);
        
    s1.Commit();

  } D (m09a); R (m09a); E;


=====
-- 
mARK bLOORE <[EMAIL PROTECTED]>

__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus
_____________________________________________
Metakit mailing list  -  [EMAIL PROTECTED]
http://www.equi4.com/mailman/listinfo/metakit

Reply via email to