Raised This Month: $ Target: $400
 0% 

write_file data separator which char should I use?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
orglee
Member
Join Date: Dec 2005
Old 06-12-2009 , 06:41   write_file data separator which char should I use?
Reply With Quote #1

Which character should I use to separate data in one line inside file. I'm interested in storing "current map", "player name" and "player steamid"
orglee is offline
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 06-12-2009 , 07:26   Re: write_file data separator which char should I use?
Reply With Quote #2

use a space so you can easily use parse() to read the content of the line again.
__________________
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
orglee
Member
Join Date: Dec 2005
Old 06-12-2009 , 07:40   Re: write_file data separator which char should I use?
Reply With Quote #3

And what if there is a space already in players nickname. Could you give me some simple example please.
orglee is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-12-2009 , 08:00   Re: write_file data separator which char should I use?
Reply With Quote #4

PHP Code:
new szString256 ];
formatexszStringcharsmaxszString ), "^"%s^" ^"%s^" ^"%s^""szNameszSteamIDszMapname ); 
Then just parse it and all will be fine
__________________

Last edited by xPaw; 06-12-2009 at 10:00.
xPaw is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-12-2009 , 09:26   Re: write_file data separator which char should I use?
Reply With Quote #5

If you use the above, formatex() will be faster.
__________________
Bugsy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-12-2009 , 20:45   Re: write_file data separator which char should I use?
Reply With Quote #6

Quote:
Originally Posted by orglee View Post
Which character should I use to separate data in one line inside file. I'm interested in storing "current map", "player name" and "player steamid"
Use anything that will not occur in the strings that you are storing. If you use something other than quotes and spaces as described above then you will have to make your own parse algorithm.
__________________
fysiks is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:54.


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