delphi - Special Character restrictions for TStringList Name-Value Pairs? -
I have a TStringList that is full of some thousand name-value pairs. One of them is I got a specific indicator by calling IndexOfName with the 'Index 004001000002000' string. I hope the valueFromIndex string returns to 'Timer2 volume 0 ~ 1274995' Instead, when I use this value using ValueFromIndex, this string returns: What's the reason? Tilde is a special character that causes the string to be shortened? Can I set it in something else? I can not reproduce the issue using the following code: This displays the required communication correctly: I also tested using the simplest method: This same 004001000002000 = Timer2 volume 0 ~ 1274995
~ 1274995
TButton.OnClick < / Code> Event (screen capture from Delphi 2007 and Delphi 7 - Delphi 2007 test):
Process TForm2.Button2Click (Sender: Tubect); Var SL: TStringList; I: integer; Start SL: = TStringList.Create; Try SL.Add ('004001000002000 = Timber 2 Volume 0 ~ 1274995'); SL.Add ('ABCDEF = test1 2 3'); I: = SL.IndexOfName ('004001000002000'); If i & gt; -1 Then Shomesz (SL. Valuefind Index [I]) and Showmess (returns' IndexAfname-1); Finally; SL.Free; End; End;
ShowMessage (SL.Values ['004001000002000']);
ShowMessage dialog was displayed.
Comments
Post a Comment