Recent

Author Topic: Patch which refactors TStrings.Text (new funct GetTextString)  (Read 3740 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2287
    • UVviewsoft
Pls see my patch, is it ok? Why ppl not commenting. For ex function need
if programmer wants to separate text with non CR/LF/CRLF or to separate with CR on Windows,
or separate with ", "

http://bugs.freepascal.org/view.php?id=28213

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Patch which refactors TStrings.Text (new funct GetTextString)
« Reply #1 on: June 03, 2015, 06:23:08 am »
probably because it is already implemented. Take a look on DelimetedText, Delimeter and StrictDelimiter properties as well as the less used TextLineBreakStyle. There is a small issue with the delimeter being a single char only but it seems no one has faced any problems with it so far.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

AlexTP

  • Hero Member
  • *****
  • Posts: 2287
    • UVviewsoft
Re: Patch which refactors TStrings.Text (new funct GetTextString)
« Reply #2 on: June 03, 2015, 06:32:42 am »
Nop, these all don't beat new func. Why? func has
1) not only char as separator (can be any str)
2) parameter AddFinalEol (no need to truncate string after making text)
3) one call (only)

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Patch which refactors TStrings.Text (new funct GetTextString)
« Reply #3 on: June 03, 2015, 06:55:43 am »
Nop, these all don't beat new func. Why? func has
1) not only char as separator (can be any str)
2) parameter AddFinalEol (no need to truncate string after making text)
3) one call (only)
1) might be an issue not for me I never needed any delimiter that is more than one char so far.
2) Truncating string to remove and then re-add finaleol is so fast that even the time needed to make that observation is a waste on top of that is not even part of a loop so it is executed once, I don't think this one deserves  any attention.
3) now that is a straw-man if I ever seen one. a single call? Write a class helper and have it done in a single call if that is so important to you.

The main reason for your patch to be rejected is compatibility with delphi as far as I can see. Personally I do not mind either way but I wouldn't vote for it either if asked. In any case make sure that your defaults are not delphi incompatible and drop a line on the mailing list requesting for comments from the team members. Keep in mind that 3 days with out comments is not that big of a deal.

In any case thank you for your time keep up the good work.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

AlexTP

  • Hero Member
  • *****
  • Posts: 2287
    • UVviewsoft
Re: Patch which refactors TStrings.Text (new funct GetTextString)
« Reply #4 on: June 03, 2015, 07:05:48 am »
..patch to be rejected is compatibility with delphi as far as I can see.
What? What compat issue it has? I dont see. U see it? it's new func. Old code works same

AlexTP

  • Hero Member
  • *****
  • Posts: 2287
    • UVviewsoft
Re: Patch which refactors TStrings.Text (new funct GetTextString)
« Reply #5 on: June 03, 2015, 07:08:29 am »
..single call if that is so important to you.
No so important. It's item3 above item 1 and item 2. Main item is refactorin.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Patch which refactors TStrings.Text (new funct GetTextString)
« Reply #6 on: June 03, 2015, 07:46:58 am »
..patch to be rejected is compatibility with delphi as far as I can see.
What? What compat issue it has? I dont see. U see it? it's new func. Old code works same
sorry I don't have "stable" access to delphi this days and stringlist is very low on my use list so I can't be trusted to spot compatibility problems I just mentioned it so you are aware. As far as I see the issue has been assigned to one of the most active members, so just be  a bit patient and then post on the mailing list. I"m off to start my day see you all later.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

 

TinyPortal © 2005-2018