Hi there...I need to incorporate pagination in my program which produces over a 500 records...each record is about 4 lines approx. 4-5 fit on the screen...i am not certain abt how to do this but i gave this a shot:
since i know the number of records that'd fit on the screen, I take a counter (chk=0) and increment everytime the function that prints one record is called...as soon as chk==5, i ask the user to print N for the next 5 records and set chk back to 0...doesn't work!Code:/* while(!feof(fp)) { while(fgets(line,300,fp)!=NULL) { chk++; funk(line, fp); x=ftell(fp); fseek(fp,x,0); if(chk==5) { printf("Press 'N' for next set of records\n\n OR\n\n'X' to Quit"); getchar(); scanf(" %c",&ans1); if(ans1=='N') { continue; chk=0; } else exit(); } } } */
any suggestions will be greatly appreciated...cheers!



LinkBack URL
About LinkBacks



