Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (NewbieZorro, TipmyPip, AndrewAMD), 14,749 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
File_write in txt #319721
04/17/10 07:07
04/17/10 07:07
Joined: Jun 2008
Posts: 428
Rasch Offline OP
Senior Member
Rasch  Offline OP
Senior Member

Joined: Jun 2008
Posts: 428
Hi there,

another problem occured wink

I got my server running, and everytime someone joins a text with the ip and and ID will be logged in a txt file.

This works great but my problem now is. I can write only one log. Everytime i´m logging in again it clears the txt file and writes the new datas in it. How can i manage that file_write not clears the txt file instead of that just writes after all other found texts in the file.

Here´s the code:

Code:
var login_log = file_open_write ("login_log.txt");
file_str_write(login_log,global_join_leave_msg);
file_close (login_log);



edit: Augen auf beim Eierkauf

file_open_append (STRING* name);

Another problem. Is it possible to manage a line skip in a txt file? I tried to add \n to my string but it just creates a black symbol. And the following logs are just added to the ende of the forst logs.

But i want a strucuture after every log it should do a line skip so that i have my logs line for line separated. Any ideas? grin

Last edited by Rasch; 04/17/10 07:42.
Re: File_write in txt [Re: Rasch] #319732
04/17/10 11:39
04/17/10 11:39
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Some Texteditors have problems with \n.
I write my own function for that:

void WRITE_ENTER(my_handle)
{
file_str_write (my_handle,"
");
}

between the two "" you have to press enter. Now you can call WRITE_ENTER(Filehandle); and in all Texteditors you have a new line...

Last edited by Widi; 04/17/10 11:50.
Re: File_write in txt [Re: Widi] #319777
04/17/10 17:07
04/17/10 17:07
Joined: Jun 2008
Posts: 428
Rasch Offline OP
Senior Member
Rasch  Offline OP
Senior Member

Joined: Jun 2008
Posts: 428
hell yeah thats some really easy solution. and it works perfectly!

Thanks very much grin

Re: File_write in txt [Re: Rasch] #319841
04/18/10 10:43
04/18/10 10:43
Joined: Mar 2005
Posts: 564
/www/europe/ germany/index.php
TSG_Torsten Offline

User
TSG_Torsten  Offline

User

Joined: Mar 2005
Posts: 564
/www/europe/ germany/index.php
You can also use the "\n" notation, I think this is a better way then pressing enter (because of encoding)
file_str_write(my_handle,"\n");

Edit: Ok, after reading I saw that it didn't work for you, Have you also take a look at the file with a "better" editor like Notepad++ ?
Because sometimes Notepad shows characters wrong. Anyway, if I use \n and open the file I have a line break.

Regards
TSGames

Last edited by TSG_Torsten; 04/18/10 10:46.
Re: File_write in txt [Re: TSG_Torsten] #319843
04/18/10 10:54
04/18/10 10:54
Joined: Jun 2008
Posts: 428
Rasch Offline OP
Senior Member
Rasch  Offline OP
Senior Member

Joined: Jun 2008
Posts: 428
Notepad is a .rtf file?

Re: File_write in txt [Re: Rasch] #319855
04/18/10 12:01
04/18/10 12:01
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Yes, there another editors that working with \n...


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1