Hey all
sorry if the posts twice the first time gave me an error. basically 
i just need to know how to move to next line of a text file if the 
first word does not match the word searched for.
using borland builder this what i have so far. ive checked loads of 
tutorials on th net just cant seem to find what i need . or is there 
a better way to do this altogether?
cheers
g


String filename;
        string FileCompare = {""};
        filename=InputBox("FileOpen", "Enter name of file to 
Open","");

        ifstream file;

        file.open("AsteroidsSave.txt");

        if(!file)

        {

                Form1->Canvas->TextOutA(20,300,"UNABLE TO OPEN 
FILE!!");



        }
        else
        {
                while(file)

                {
                   file >> FileCompare;
                
                   if (filename.c_str() == FileCompare)
                   {
                    Form1->Canvas->TextOutA
(20,300,"worked!               " ) ;
                        file >> theShip.points[0].x ;

                   }
                   else
                   {
                   //next line code??
                   }

               

                }//end while
        }



       

        file.close();



Reply via email to