As the SetKeyValue converts the 'value' argument to string it does not work correctly with Windows regional setting that don't use '.' as the floating point separator. This effectively prevents the usage of SetKeyValue/GetKeyValue for floating point values. Buggy code example (local floating point separator is ','):
Code: Select all
ScenEdit_SetKeyValue("AAA",2.2)
my_var = tonumber(ScenEdit_GetKeyValue("AAA"))
ScenEdit_MsgBox("Hi: " .. my_var,8)
ERROR: [string "chunk"]:3: attempt to concatenate global 'my_var' (a nil value)
which shows that tonumber() is unable to convert the value back to numerical (the string returned by GetKeyValue() is "2,2" in this example while tonumber expects "2.2").