brofield/simpleini

Stops reading values.

Closed this issue · 4 comments

After it reads a certain amount of values(idk how many exactly) it just stops. How can I fix this?

Provide a test case.

On Sat, 10 Nov. 2018, 20:16 Rampant13 @.*** wrote: After it reads a certain amount of values(idk how many exactly) it just stops. How can I fix this? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#40>, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWeMl50YiENByqWJ3Z6eZv7mKZsy8y8ks5utqd-gaJpZM4YX7Fm .

CSimpleIniA myini;
myini.SetUnicode(true);
if (myini.LoadFile("C:\Users\Public\myinifolder\myinifile.ini") < 0)
throw "Loading of INI FAILED!";
I run that once on startup then I do this to get the actual text I want from the ini

static string temp2;
temp2 = myini.GetValue("Mything", temp.c_str(), "");

temp is filled by another string that's set elsewhere in my application.

that second part is looped in my application and the way I have designed my application it must be looped.

I suggest that you add some logging to your program so that you can find out when exactly it's stopping. If it always stops at the same values, set a breakpoint for those values and then step through the function to see what is happening. I expect that you will find that is a problem somewhere in your code. The function getvalue is very simple and doesn't load anything from the file, it is just reading the value out of memory. Happy to be proven wrong, if it is in my code, please provide a self contained test case that I can compile and run that reproduces the problem.

On Mon, 12 Nov. 2018, 22:47 Rampant13 @.*** wrote: Provide a test case. … <#m_-5851973991535968860_> On Sat, 10 Nov. 2018, 20:16 Rampant13 @.*** wrote: After it reads a certain amount of values(idk how many exactly) it just stops. How can I fix this? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#40 <#40>>, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWeMl50YiENByqWJ3Z6eZv7mKZsy8y8ks5utqd-gaJpZM4YX7Fm . CSimpleIniA myini; myini.SetUnicode(true); if (myini.LoadFile("C:\Users\Public\myinifolder\myinifile.ini") < 0) throw "Loading of INI FAILED!"; I run that once on startup then I do this to get the actual text I want from the ini static string temp2; temp2 = myini.GetValue("Mything", temp.c_str(), ""); temp is filled by another string that's set elsewhere in my application. that second part is looped in my application and the way I have designed my application it must be looped. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#40 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWeMglozKZMKURYs_gRNVB0vhCGyftZks5uuW3SgaJpZM4YX7Fm .

Turns out it was my fault my ini file was broken =/

Thank you for your help though!