below is part of the function i wrote, I tried editing it to give an error when there is no data in the file but cant... can anyone help?
the case switch is displaying the below, but when there is no data in the file it just do nothing, i want to have an error or msg saying "no file or record" when they try to display an empty file.
PHP Code:
void display_rec(void)
{
int index;
float total_fee;
for(index=0;index<count;++index)
{
clrscr();
mainpage();
gotoxy(27,8); printf("@ Display Member Record @");
gotoxy(27,9); printf("~~~~~~~~~~~~~~~~~~~~~~~~~");
gotoxy(20,11); printf("Member First Name : %s\n", mem[index].mem_fname);
gotoxy(20,12); printf("Member Last Name : %s\n", mem[index].mem_lname);
gotoxy(20,13); printf("Member NRIC No. : %s\n", mem[index].mem_nric);
gotoxy(20,14); printf("Member Address : %s\n", mem[index].mem_address);
gotoxy(20,15); printf("Member Gender : %s\n", mem[index].mem_gen);
gotoxy(20,16); printf("Member Birth Date : %s\n", mem[index].mem_dob);
gotoxy(20,17); printf("Member Contact No.: %s\n", mem[index].mem_tel);
gotoxy(20,18); printf("Amount Paid Per Month : $%.2f\n", mem[index].mem_installp);
gotoxy(20,19); printf("No. Of Months Paid : %i\n", mem[index].mem_month);
total_fee=mem[index].mem_installp*mem[index].mem_month;
gotoxy(20,21); printf("Total amount Paid is $ %.2f\n", total_fee);
// gotoxy(20,22); printf("Amount left to be Paid is $");
gotoxy(23,24);
printf("Press Enter key to view more record");
getchar();
fflush(stdin);
clrscr();
}
}