I pass the config file name to it, and it appends .ini to the file name and adds the project directory in front of the whole thing. For example, I pass it MyFile and it’ll turn it into C:\ProjectDir\MyFile.ini
Anyway, I have a for loop that runs the function to read the following keys from the config file: key1, key2, key3.
The config file looks like this:
key1=One
key2=Two
And the function returns:
One
Two
Two
As you may have noticed, key3 does not exist in the config file but the function always returns the last value it successfully read anyway, in this case, Two. If I were to change the config file to:
key1=One
It would return
One
One
One
Is this a bug or am I doing something wrong?
I’m using UE 4.27.2, but I assume this is also the case in UE5.
I’m feeding a string array of Key1, Key2, Key3 into the for loop, the function reads those keys from the config file and prints whatever value they have.
The config looks like this:
[Section1]
Key1=One
Key2=Two
Key3 is missing from the config but the function will still return Two, so it does seem that the Value variable is not being cleared in the GetString function.