Raised This Month: $ Target: $400
 0% 

Need Some Help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-05-2009 , 18:43   Re: Need Some Help
Reply With Quote #2

Are you saying that it doesn't work at all? Are there any errors, that is where I start to get things working.

Anyways, The first thing that I noticed is your for loop. I was taught to never change the incrementing variable inside the for loop. So, I would use a while loop and get rid of "a" completey:

PHP Code:
        while( NumberOfNamesFromFile MAXNAMES && !feof(fHandle) ) 
        { 
            
//Get line 
            
fgets(fHandlename31); 
            
            
trim(name)
            
            
//Work away comments and blank lines
            
if( name[0] == ';' || !name[0] )  
            { 
                
//Line is not counted 
                
continue; 
            } 
            
copy(names[NumberOfNamesFromFile], 31name)     
            
NumberOfNamesFromFile++;     
        } 
Also, I would always use braces, Always. It makes it much easier to read the code. I see some places that I can't tell if they are supposed to go with the if statement or not.

And, always make sure that all of your parentheses are closed.
__________________

Last edited by fysiks; 06-05-2009 at 18:52.
fysiks is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:53.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode