Is it a possibility that the boolean values of vbscript converted to strings are localized on non-English systems? I just got a report about an error from one of the script users, and looks like on their German system the False value when converted via CStr is saved to settings.ini file as “Falsch”, but then when the script tries to read the variable from ini file, there is an error since CBool can’t convert the Falsch to boolean False… I have not seen this before. They reported it only started happening since SR18 upgrade.
Here is a sample code to test, if anyone with non-English (German preferably) system could test. I am curious to see what the ini file created on Desktop looks like:
Dim objShell,strPath : Set objShell = CreateObject("Wscript.Shell")
strPath = objShell.SpecialFolders("Desktop") & "\test.ini"
Dim a : a = False
Dim b : b = Rhino.SaveSettings(strPath, "TestA", "BoolTest", Cstr(a))
Rhino.Print CBool(Rhino.GetSettings(strPath, "TestA", "BoolTest"))
Thanks so much for testing. So it looks like on French machine it can handle the conversions well.
Could you please try one more thing: Rhino.Print CBool("Faux")
Seems like on the German user system converting this value from ini file (“Falsch”) into boolean results in error… which is confusing because the same that the sample script seems to do on your end works (That’s why it prints “False” to command line, meaning reading French from .ini and converting to boolean works OK…)
Dim objShell,strPath : Set objShell = CreateObject("Wscript.Shell")
strPath = objShell.SpecialFolders("Desktop") & "\test.ini"
Dim a : a = False
Dim b : b = Rhino.SaveSettings(strPath, "TestA", "BoolTest", Cstr(a))
Rhino.Print CBool(Rhino.GetSettings(strPath, "TestA", "BoolTest"))
Rhino.Print Cstr(a)
Rhino.Print Cbool("Faux")
Thank you again Graham! - all looks correct… which makes me think there could be something German-version specific. I am trying to have the user do some testing for me.