lol, I'm back.... I'll probably get it fixed on my own, but still.... maybe someone else will have the same problem and can figure it out from this instead of having to make a post....
Code:
case 'b': //pulls list of bowlers, creates score file for bowlers, adds scores to file
{
if (caseb == 1)
goto LOAD;
else
goto STARTB;
STARTB: //pulls list of bowlers
value = 0;
MasterlistIn.open("Masterlist.txt");
getline(MasterlistIn, Master[value]);
value++;
while (MasterlistIn)
{
getline(MasterlistIn, Master[value]);
value++;
}
control = value;
MasterlistIn.close();
caseb++;
LOAD: //creates/opens bowler score file and adds scores
cout << "Select created bowler." << endl << endl;
control = value;
value = 0;
for (value = 0; value < control - 1; value++)
{
cout << "Press " << value + 1 << " to load " << Master[value] << "." << endl;
}
cin >> loadbowl;
system("cls");
cout << "Loading bowler data for " << Master[loadbowl - 1] << endl;
bowler = Master[loadbowl - 1] + "_scores.txt";
inData[loadbowl - 1].open(bowler.c_str());
inData[loadbowl - 1].close();
outData[loadbowl - 1].open(bowler.c_str(), ios::app);
Sleep(1000);
system("cls");
cout << Master[loadbowl - 1] << " loaded." << endl;
system("cls");
cout << "Enter scores (3 games!)." << endl << endl
<< "Score for first game." << endl;
cin >> game1;
cout << endl
<< "Score for second game." << endl;
cin >> game2;
cout << endl
<< "Score for third game." << endl;
cin >> game3;
set = game1 + game2 + game3;
cout << "Total set is " << set << " ." << endl;
outData[loadbowl - 1] << game1 << endl
<< game2 << endl
<< game3 << endl
<< set << endl;
Sleep(1000);
outData[loadbowl - 1].close();
} break;
ok, first problem, the loop, fixed my initial problem which was after returning to the menu and choosing this option, lol, maybe I should explain what the code does.... Ok, this part, it opens the master list from my previous thread and pulls out all the names.... shows the list on screen, the user selects a name from the list, the program creates a file for the name and then lets the user input the scores for that name.... it adds the scores together and gives that total.... program gives th eoption to exit or return to menu....
now for the problems.... my initial problem I was talking about earlier, you run this option, return to the menu and select this option again.... The list of names doesn't show, but you can type in the number for one of the names, and it's recognized.... I fixed that by the if-goto-else-goto and the caseb++ up at the top.... But each time you run this option without exiting, the last name on the list doesn't show.... I'm testing it with 4 names, the first time, all four show, the second time, only the first 3 show, the 3rd time, only the first two show.... I'm sure if I add control++ after the control = value right inside of LOAD, it'll fix it, but I'm not sure.... might have to setup an if statement and put a control in there like I did with the caseb++ and the if-goto at the top....
next problem.... it won't copy the scores and total set into the file for the very first name on the list.... it works fine for all of the other names, just the first on the list is giving me problems....