Hi,
my name is Andrea and I'm a newbie of using Metakit.
I'have written a simple application in c++ using Metakit and it works fine,
only a problem:
when I delete some rows from my view and I save back the view to the file,
the older data remain in the file and the size of the file never decrease.
When I open the file again in my application or with KitViewer I don't see
the rows that I have deleted, but they are still in the file. I can see it
if I open the file with Notepad, in this case I see the older data and the
new data.
Below the code I have written.
Thanks for your help and excuse me for my bad english
Andrea
########################################
// on launching application
c4_Storage database ("data.db",true);
c4_View table =
database.GetAs("scadenzario[yyyy:I,mm:I,gg:I,titolo:S,note:S]");
// function that insert new record
void insert(int yyyy, int mm, int dd, string note){
c4_IntProp anno("yyyy"), mese("mm"), giorno("gg");
c4_StringProp corpo("note"), title("titolo");
c4_Row nuova;
anno(nuova)=yyyy;
mese(nuova)=mm;
giorno(nuova)=dd;
const char* pippo = note.c_str();
c4_Row pluto;
pluto=corpo.AsRow(pippo);
nuova.ConcatRow(pluto);
title(nuova)="Prova Scadenzario";
table.Add(nuova);
}
// function that delete n record from 0
int deleteDB(string nome, int number){
if (table.GetSize() < number)
number = table.GetSize();
if (number>0)
table.RemoveAt(0,number);
return number;
}
// last statement in the main
database.Commit();
##########################################
_____________________________________________
Metakit mailing list - [EMAIL PROTECTED]
http://www.equi4.com/mailman/listinfo/metakit