File of records related question.
Posted on 2004-08-12
i just need some information regarding a file of records.
U see i have this record type :
TGsmRecord = record
DateAdded : TdateTime;
GsmNumber : String;
and a file of TGsmRecord where i save all my TGsmrecords in. and i just do Write(File,TgsmRecordVar);
I noticed each record takes up 40 bytes in the file. When i looked at the file i noticed something about the Shortstring Gsmnumber.
1.K.v..@.0111111111ewList....`..`C..,... is one record in the file where Gsmnumber equaled 0111111111 (10 chars). Notice the text after the 0111111111 part, it says "ewList" which comes from viewlist which is part of a name used for one of my controls in the program (a listview).
I like to know if this is normal ? it's probably because The shortstring has always a static length. But i find it weird that when i load up my records from the file again. The number is recognized as just 0111111111. and the "Garbage" doesn't affect my records / program at all.
I just like to know if it would ever make my program crash or sumthing or make the loaded Gsmnumber have a diffrent value from the one saved into the file due to the garbage.