Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   adding to existing files and not replacing (http://forums.winamp.com/showthread.php?t=251368)

Cyong 18th July 2006 05:53

adding to existing files and not replacing
 
ok i got an interesting problem, i have a game that is customizable so that people can put in their own charecters.

The file listing the directory of each charecter is pretty straight forward

PHP Code:

<Name>x2</name>
<
Name>x3</name>
<
Name>x4</name>
<
Name>x5</name>
<
Name>x6</name

now people can add any charecter they want so the file can easily change and look like

PHP Code:

<Name>x2</name>
<
name>Custom</name>
<
Name>x3</name>
<
Name>x4</name>
<
Name>x5</name>
<
Name>x6</name

in updates i want to be able to simply add the new lines of code to the file instead of just replacing it, that way my users wont have to re-edit the file after every update. any suggestions?

Afrow UK 18th July 2006 10:16

Try this function:
http://nsis.sourceforge.net/Write_to...le_line_number

If you don't know what line to write to, you can use:
http://nsis.sourceforge.net/ReplaceB...kers_in_a_file
And replace between </name> and <Name>.

These functions are old, so I also recommend using the TextReplace plugin.

-Stu

Cyong 19th July 2006 07:15

Quote:

Originally posted by Afrow UK
Try this function:
http://nsis.sourceforge.net/Write_to...le_line_number

If you don't know what line to write to, you can use:
http://nsis.sourceforge.net/ReplaceB...kers_in_a_file
And replace between </name> and <Name>.

These functions are old, so I also recommend using the TextReplace plugin.

-Stu

hmm thanks, might have to change a few things (add a line at the bottom of the code to spcify what can be replaced) but it should do the trick. Thanks


All times are GMT. The time now is 05:47.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.