EdK | 12 Mar 21:24

corrupted data


I'm trying to use metakit with mingw C++ under windows XP, but my data
seems to be getting curupted. this is my code:

#include "mk4.h"
#include "mk4str.h"

#include <iostream>
#include <string>

const std::string test_table_name("tst");
const std::string ID_field_name("ID");
const std::string result_field_name("result");
const std::string test_number_field_name("testnum");

c4_StringProp pID (ID_field_name.c_str());
c4_DoubleProp pResult (result_field_name.c_str());
c4_LongProp   pTestNum (test_number_field_name.c_str());

int main()
{
    std::cout << "testing MetaKit" << std::endl;

    c4_Storage storage ("testmetakit.dat", true);

    std::cout << storage.Description() << std::endl;

    // Start with an empty view of the proper structure.
    c4_View record = storage.GetAs((test_table_name + "["
            + ID_field_name + ":S,"
(Continue reading)

Jean-Claude Wippler | 12 Mar 22:08

Re: corrupted data


On 12 Mar 2008, at 21:28, EdK wrote:
> I'm trying to use metakit with mingw C++ under windows XP, but my data
> seems to be getting curupted. this is my code:
[...]
>            + result_field_name + " :D]").c_str());

The space before the colon is the problem, I suspect.
(And yes, that's an ugly weakness of MK, I agree ...)

-jcw

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "metakit" group.
To post to this group, send email to metakit <at> googlegroups.com
To unsubscribe from this group, send email to metakit-unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/metakit?hl=en
-~----------~----~----~----~------~----~------~--~---

Ed Keith | 13 Mar 04:48

Re: corrupted data


--- Jean-Claude Wippler <jcw <at> equi4.com> wrote:

> 
> On 12 Mar 2008, at 21:28, EdK wrote:
> > I'm trying to use metakit with mingw C++ under
> windows XP, but my data
> > seems to be getting curupted. this is my code:
> [...]
> >            + result_field_name + " :D]").c_str());
> 
> The space before the colon is the problem, I
> suspect.
> (And yes, that's an ugly weakness of MK, I agree
> ...)
> 

I removed the space, and I'm still having the same
problem.

To give more details; I run the program twice, the
first time I enter 
ID = "ab" test = 1 result = 3.1415
the second time I enter
ID = "xy"  test = 2 result = 2.345

I look at the database in kviewer and see two rows
"ab", 1, 3.1415
"xy", 3.1415, 2.345

(Continue reading)

Jean-Claude Wippler | 13 Mar 12:34

Re: corrupted data


On 13 Mar 2008, at 04:48, Ed Keith wrote:
> To give more details; I run the program twice, the
> first time I enter
> ID = "ab" test = 1 result = 3.1415
> the second time I enter
> ID = "xy"  test = 2 result = 2.345
>
> I look at the database in kviewer and see two rows
> "ab", 1, 3.1415
> "xy", 3.1415, 2.345

I cannot reproduce this (on macosx) and get the expected results.  
Please delete the old datafile. If the problem persists, run the test  
suite with "make test". I can't think of any explanation so far.

-jcw

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "metakit" group.
To post to this group, send email to metakit <at> googlegroups.com
To unsubscribe from this group, send email to metakit-unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/metakit?hl=en
-~----------~----~----~----~------~----~------~--~---

Ed Keith | 13 Mar 21:13

Re: corrupted data


--- Jean-Claude Wippler <jcw <at> equi4.com> wrote:
> I cannot reproduce this (on macosx) and get the
> expected results.  

I build the dump demo and ran it in the database and
got the following:

testmetakit.dat: 1 properties
  tst[ID:S,testnum:L,result:D]

 VIEW     1 rows = tst:V
    0: subview 'tst'
   VIEW     2 rows = ID:S testnum:L result:D
      0: 'ab' (L?) 3.1415
      1: 'xy' (L?) 2.345

It looks like it can not read the the LongProp, so I
changed it to an IntProp and it works now. I suspect a
windows only problem with c4_LongProp.

I can us Ints where I was planning on using long, so I
have a work around. 

If I have time after I finish this project I'll look
at   c4_LongProp and let you know what I find.

Thank you for your help.

   -EdK 
(Continue reading)


Gmane