--- imach/src/imach.c 2009/07/06 10:21:25 1.133 +++ imach/src/imach.c 2009/10/29 13:18:53 1.134 @@ -1,6 +1,9 @@ -/* $Id: imach.c,v 1.133 2009/07/06 10:21:25 brouard Exp $ +/* $Id: imach.c,v 1.134 2009/10/29 13:18:53 brouard Exp $ $State: Exp $ $Log: imach.c,v $ + Revision 1.134 2009/10/29 13:18:53 brouard + (Module): Now imach stops if date of birth, at least year of birth, is not given. Some cleaning of the code. + Revision 1.133 2009/07/06 10:21:25 brouard just nforces @@ -403,11 +406,11 @@ extern int errno; #define ODIRSEPARATOR '/' #endif -/* $Id: imach.c,v 1.133 2009/07/06 10:21:25 brouard Exp $ */ +/* $Id: imach.c,v 1.134 2009/10/29 13:18:53 brouard Exp $ */ /* $State: Exp $ */ -char version[]="Imach version 0.98k, June 2009, INED-EUROREVES-Institut de longevite "; -char fullversion[]="$Revision: 1.133 $ $Date: 2009/07/06 10:21:25 $"; +char version[]="Imach version 0.98l, October 2009, INED-EUROREVES-Institut de longevite "; +char fullversion[]="$Revision: 1.134 $ $Date: 2009/10/29 13:18:53 $"; char strstart[80]; char optionfilext[10], optionfilefiname[FILENAMELENGTH]; int erreur=0, nberr=0, nbwarn=0; /* Error number, number of errors number of warnings */ @@ -4945,9 +4948,15 @@ run imach with mle=-1 to get a correct t month=99; year=9999; }else{ - printf("Error reading data around '%s' at line number %ld %s for individual %d, '%s'\nShould be a date of birth (mm/yyyy or .). Exiting.\n",strb, linei,i,line,j); - fprintf(ficlog,"Error reading data around '%s' at line number %ld %s for individual %d, '%s'\nShould be a date of birth (mm/yyyy or .). Exiting.\n",strb, linei,i,line,j);fflush(ficlog); + printf("Error reading data around '%s' at line number %ld for individual %d, '%s'\nShould be a date of birth (mm/yyyy or .). Exiting.\n",strb, linei,i,line); + fprintf(ficlog,"Error reading data around '%s' at line number %ld for individual %d, '%s'\nShould be a date of birth (mm/yyyy or .). Exiting.\n",strb, linei,i,line);fflush(ficlog); + goto end; + } + if (year==9999) { + printf("Error reading data around '%s' at line number %ld for individual %d, '%s'\nShould be a date of birth (mm/yyyy) but at least the year of birth should be given. Exiting.\n",strb, linei,i,line); + fprintf(ficlog,"Error reading data around '%s' at line number %ld for individual %d, '%s'\nShould be a date of birth (mm/yyyy) but at least the year of birth should be given. Exiting.\n",strb, linei,i,line);fflush(ficlog); goto end; + } annais[i]=(double)(year); moisnais[i]=(double)(month); @@ -5172,7 +5181,7 @@ run imach with mle=-1 to get a correct t agev[m][i]=1; else if(agev[m][i] agemax){ agemax=agev[m][i];