hey Mickey
sorry that was just for myself to see if the correct code was being 
executed. Not using that in final version just as i was debugging. but i get 
your point and will use messageboxes when if i need to tell the player 
something
thanks
gav


>From: Mickey Mathieson <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: [email protected]
>Subject: Re: [c-prog] search a text file
>Date: Tue, 3 Apr 2007 06:31:50 -0700 (PDT)
>
>
>--- glogic_1 <[EMAIL PROTECTED]> wrote:
>
> > 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();
> >
> >
> >
> >
>
>
>   Form1->Canvas->TextOutA
> > (20,300,"worked!               " ) ;
>
>One comment - you should use Application->MessageBox()
>to display messages to the user. The Canvas property
>will not repaint and the message will be lost.
>
>Example : Application->MessageBox("This should be on
>top.", "Look", MB_OK);
>
>
>
>
>Mickey M.
>Construction Partner Inc.
>http://www.constructionpartner.com
>
>
>
>____________________________________________________________________________________
>Expecting? Get great news right away with email Auto-Check.
>Try the Yahoo! Mail Beta.
>http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html

_________________________________________________________________
Mortgage refinance is Hot. *Terms. Get a 5.375%* fix rate. Check savings 
https://www2.nextag.com/goto.jsp?product=100000035&url=%2fst.jsp&tm=y&search=mortgage_text_links_88_h2bbb&disc=y&vers=925&s=4056&p=5117

Reply via email to