Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AemStones, AndrewAMD, gamers, Kingware), 1,679 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 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 | chip programmers | 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