Title: Help on Int property

Hi, all,

     I am just starting to use Metakit (2.9.4.2). I used the demo.cpp as an example and wrote
the following piece of code. When I use the dump to dump the result, the integer part of values
are all zeros. Where did I do wrong? Please advise.

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

#include <stdio.h>

main()
{

       c4_StringProp pName ("name");
       c4_IntProp pValue ("value");
       c4_Storage storage("kdeck.dat", true);
       c4_View kdeck = storage.GetAs("kdeck[name:S, value:I]");
       c4_Row row;
       pName (row) = "proc_cdp_first";
       pValue(row) = 1;
       kdeck.Add(row);
       pName (row) = "proc_cdp_last";
       pValue(row) = 676;
       storage.Commit();
       int v1 = pValue(row);
       printf("V1 = %d\n", v1);
       kdeck.Add(row);
       int v2 (pValue (kdeck[1]));
       printf("V2 = %d\n", v2);
       pName (row) = "proc_cdp_inc";
       pValue(row) = 1;
       kdeck.Add(row);
       storage.Commit();

       return(0);
}

Sincerely,

Jim Hu

Reply via email to