AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Replacing a value in a line (File) (https://forums.alliedmods.net/showthread.php?t=22248)

Cheap_Suit 12-22-2005 08:01

Replacing a value in a line (File)
 
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)     }   }

Xanimos 12-22-2005 08:48

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) )


All times are GMT -4. The time now is 15:51.

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