View Single Post
  #887  
Old 09-02-2024, 12:08
K4miKaZe's Avatar
K4miKaZe K4miKaZe is offline
Registered User
 
Join Date: Sep 2018
Location: Spain
Posts: 146
Thanks: 177
Thanked 235 Times in 84 Posts
K4miKaZe is on a distinguished road
Quote:
Originally Posted by Cesar82 View Post
Thank you for the informations.

It really is wrong and the solution is the same.
Maybe including something to remove the first space in the value if it exists would be interesting.
Yeah, that should be easy now, i just leaved it that way because i was too tired yesterday to keep looking. Will take a look in a few and update this message with the full code change. I'm still testing out the new CIU, lot of things have changed since 2020.

Thank's to you for keeping this up !!!

EDIT:

So seems like adding Trim to the LineDecode was enough to fix the spacing issue. I've done some tests and all went fine. 1st test was to just let CIU make a clean .ini with the language feature, second test was letting CIU modify an existent .ini to replace the value with the language feature and another test to add custom values without the language feature. All went fine. So here is the original code on the latest beta hf2 (from december) and the only little change i made to it.

Original:
Code:
          begin
            if FileExists(IniName) or (StrToIntDef(LineDecode(TmpStr, 'Create', '0'), 0) = 1) then
            begin
              IniValue := LineDecode(TmpStr, '', '');
              if (IniValue = '') or ((Pos('=', IniValue) > 0) and (Pos('|', IniValue) > 0) and (Pos(LowerCase(ActLangShort + '='), LowerCase(IniValue)) = 0)) then
Modified (marked in red):

Code:
          begin
            if FileExists(IniName) or (StrToIntDef(LineDecode(TmpStr, 'Create', '0'), 0) = 1) then
            begin
              IniValue := Trim(LineDecode(TmpStr, 'Value', ''));
              if (IniValue = '') or ((Pos('=', IniValue) > 0) and (Pos('|', IniValue) > 0) and (Pos(LowerCase(ActLangShort + '='), LowerCase(IniValue)) = 0)) then

Last edited by K4miKaZe; 09-02-2024 at 15:31.
Reply With Quote
The Following User Says Thank You to K4miKaZe For This Useful Post:
Cesar82 (09-02-2024)