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 004001000002000 = Timer2 volume 0 ~ 1274995

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:

  ~ 1274995   

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: 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;   

This displays the required communication correctly:

ShowMessage result

I also tested using the simplest method:

  ShowMessage (SL.Values ​​['004001000002000']);   

This same ShowMessage dialog was displayed.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -