AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   write_file data separator which char should I use? (https://forums.alliedmods.net/showthread.php?t=94513)

orglee 06-12-2009 06:41

write_file data separator which char should I use?
 
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"

SchlumPF* 06-12-2009 07:26

Re: write_file data separator which char should I use?
 
use a space so you can easily use parse() to read the content of the line again.

orglee 06-12-2009 07:40

Re: write_file data separator which char should I use?
 
And what if there is a space already in players nickname. Could you give me some simple example please.

xPaw 06-12-2009 08:00

Re: write_file data separator which char should I use?
 
PHP Code:

new szString256 ];
formatexszStringcharsmaxszString ), "^"%s^" ^"%s^" ^"%s^""szNameszSteamIDszMapname ); 

Then just parse it and all will be fine

Bugsy 06-12-2009 09:26

Re: write_file data separator which char should I use?
 
If you use the above, formatex() will be faster.

fysiks 06-12-2009 20:45

Re: write_file data separator which char should I use?
 
Quote:

Originally Posted by orglee (Post 847061)
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.


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

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