#include #include #include #include /////////////////////////////////////////////////////////// // Testfil /////////////////////////////////////////////////////////// class TTest_application : public TApplication { protected: bool create() { dispatch_e_menu(BAR_ITEM(1)); return TRUE; } bool destroy() { return TRUE; } bool menu(MENU_TAG); public: TTest_application() {} }; bool TTest_application::menu(MENU_TAG) { TLocalisamfile tab(LF_TABCOM); const TRecnotype n = tab.items(); time_t start; TRecnotype r = 1; TString80 msg; { TProgind p(n, "Lettura file tabelle comuni", TRUE, TRUE, 32); start = time(NULL); for (tab.first(); tab.good(); tab.next(), r++) { if ((r % 50) == 0) { msg.format("%ld records %ld sec", r, time(NULL) - start); p.setstatus(r); p.set_text(msg); } if (p.iscancelled()) break; } } const time_t t = time(NULL) - start; msg.format("%ld records in %ld sec\n%lg records per sec", r, t, (double)r/t); message_box(msg); return TRUE; } /////////////////////////////////////////////////////////// int ba1200(int argc, char** argv) { TTest_application a; a.run(argc, argv, "Test File"); return 0; }