Foggn \n sign ...


(acQu) #1

Hey,

why does this code not work with me:

trap_FS_Write( "abc
aa" , 6, f);

Am i too stupid to make a newline in my file with this or what ? O_O

Also how does a (etpub) xpsave.cfg file look with you guys. With me there is no single newline made inside there, although the code actually says ‘make newlines’ …

complete code here:


int len;
fileHandle_t f;

len = trap_FS_FOpenFile("xpsave.cfg", &f, FS_WRITE);

if(len < 0) {
	G_Printf("could not open file
");
	return;
}

trap_FS_Write( "abc
aa" , 6, f);
trap_FS_FCloseFile(f);

Whats wrong O_O


(Yatta) #2

I have no idea on how the code works, but cant you just use the command one time for each line ?


(crapshoot) #3

depends on what you are opening it with really. notepad++ handles the newline fine with your example while regular notepad does not. if you use
, regular notepad would probably give you the format you want. iirc, windows wants
, linux just needs
, and mac just needs \r. not 100% sure about that though.


(Shanks) #4

^^ Correct.

Try opening the files in Wordpad if you don’t have Notepad++.


(acQu) #5

xD I was hoping the thread would pass without anybody noticing it xD
But yeah crapshoot you are right. Opening teh file with wordpad was all i needed to do.

Thanks for answers :slight_smile:

(P.S. why does this sh!t always happen to me …)


(Nail) #6

Notepad ++ is free and offers highlighting in several helpful areas


(twt_thunder) #7

or this:

http://www.pnotepad.org/