| Mirage Source http://web.miragesource.net/forums/ |
|
| Saving in Binary http://web.miragesource.net/forums/viewtopic.php?f=201&t=3607 |
Page 1 of 1 |
| Author: | Anthony [ Thu Apr 17, 2008 2:27 am ] |
| Post subject: | Saving in Binary |
Well, I have a question about saving data in Binary. Storing say a string. Say my NpcRec has AttackSay as String * 255. However the string used in Npc 1 is actually only 30 characters long. The saving stores all the white space and includes all those extra bytes |
|
| Author: | Rezeyu [ Thu Apr 17, 2008 2:43 am ] |
| Post subject: | Re: Saving in Binary |
Don't you HAVE to use fixed length strings in Binary? I don't see why it's a problem anyways. =/ |
|
| Author: | Lea [ Thu Apr 17, 2008 2:47 am ] |
| Post subject: | Re: Saving in Binary |
Store the length of the string as an integer (2 bytes) then Store Trim$(String) which removes the trailing white space. To load, read in the length of the string, then create a string to load in Length bytes. |
|
| Author: | Rezeyu [ Thu Apr 17, 2008 3:01 am ] |
| Post subject: | Re: Saving in Binary |
Makes sense, I still don't see why it's that big of a deal though. It can't use up very much filesize. >.> |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|