Aggiunto ba1200.cpp.

Programma per testare la lettura sequenziale dei file.


git-svn-id: svn://10.65.10.50/trunk@21 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1994-08-17 09:56:27 +00:00
parent 3a6fa88f87
commit 65e62eda30
5 changed files with 85 additions and 23 deletions

View File

@ -5,15 +5,24 @@
#include "ba1.h"
#define usage "Errore - uso : ba1"
#define usage "Errore - uso : ba1 [-{0|1}]"
int main(int argc,char** argv)
{
int rt = 0 ;
if (argc!=1) fatal_box(usage);
rt = ba1100(argc,argv,FALSE) ;
if (argc == 1) rt = ba1100(argc,argv);
else
if (argc == 2)
{
switch (argv[1][1])
{
case '0': rt = ba1100(argc,argv); break;
case '1': rt = ba1200(argc,argv); break;
default: fatal_box(usage); break;
}
}
else fatal_box(usage);
return rt;
}

View File

@ -1,16 +1,15 @@
#ifndef __BA1_H
#define __BA1_H
#ifdef MAIN
#define extern
#endif
#ifdef MAIN
#undef extern
#endif
#endif // __BA1_H
int ba1100(int argc, char* argv[], bool insmode);
int ba1200(int argc, char* argv[], bool insmode);
int ba1300(int argc, char* argv[], bool insmode);
#ifndef __BA1_H
#define __BA1_H
#ifdef MAIN
#define extern
#endif
#ifdef MAIN
#undef extern
#endif
#endif // __BA1_H
int ba1100(int argc, char* argv[]);
int ba1200(int argc, char* argv[]);

View File

@ -466,7 +466,7 @@ while (!done)
return TRUE;
}
int ba1100(int argc, char* argv[], bool insmode)
int ba1100(int argc, char* argv[])
{
BA1100_application a;

52
ba/ba1200.cpp Executable file
View File

@ -0,0 +1,52 @@
#include <applicat.h>
#include <isam.h>
#include <progind.h>
#include <urldefid.h>
///////////////////////////////////////////////////////////
// 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();
TProgind p(n, "Lettura file tabelle comuni", TRUE, TRUE, 32);
const time_t start = time(NULL);
TRecnotype r = 1;
TString80 msg;
for (tab.first(); tab.good(); tab.next(), r++)
{
msg.format("%ld rec : %ld sec", r, time(NULL) - start);
p.addstatus(1);
p.set_text(msg);
if (p.iscancelled()) break;
}
return TRUE;
}
///////////////////////////////////////////////////////////
int ba1200(int argc, char** argv)
{
TTest_application a;
a.run(argc, argv, "Test File");
return 0;
}

View File

@ -36,8 +36,10 @@ $(O)/ba1100.o: ba1100.cpp ba1.h $(BA1100H) $(I10) $(I12) $(I23) $(I24) $(I31) $(
$(O)/ba1102.o: ba1102.cpp ba1.h $(BA1100H) $(I33) $(I37) $(I39) $(I40) $(I43)
$(EP)ba1: $(O)/ba1.o $(O)/ba1100.o $(O)/ba1101.o $(O)/ba1102.o $(LIBD1) $(EP)ba1.frl
$(LINK) $(LFLAGSD1) $@ $(O)/ba1.o $(O)/ba1100.o $(O)/ba1101.o $(O)/ba1102.o
$(O)/ba1200.o: ba1200.cpp $(I24) $(I30) $(I37)
$(EP)ba1: $(O)/ba1.o $(O)/ba1100.o $(O)/ba1101.o $(O)/ba1102.o $(O)/ba1200.o $(LIBD1) $(EP)ba1.frl
$(LINK) $(LFLAGSD1) $@ $(O)/ba1.o $(O)/ba1100.o $(O)/ba1101.o $(O)/ba1102.o $(O)/ba1200.o
$(EP)ba1.frl: ba1.url $(U1)
$(RCOMP) ba1 -l $(EP)ba1