Raised This Month: $ Target: $400
 0% 

Replacing a value in a line (File)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 12-22-2005 , 08:01   Replacing a value in a line (File)
Reply With Quote #1

Am I doing this the right way?

Code:
Input_Value = 1 for(Line = 0; read_file(File, Line, Text, 32, len); Line++) {     parse(Text, TestText, 32, TextValue, 99)     if(equali(FirstString, Input_text, 32))     {         new TextStr[255]         format(TextStr, 254, "%s %d", FirstString, Input_Value)         write_file(File, TextStr, Line)     }   }
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 12-22-2005 , 08:48  
Reply With Quote #2

No. in the for loop. When you do that the line you find will be the next line you write to. use a while loop.
while( read_file( File , Line++ , Text , 32 , len) )
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Reply



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 15:51.


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