I can't reproduce this. This is my best guess as to what you are describing:
string proc test_profile1()
string fn[_MAX_PATH_]
string section[32] = "section"
string item[32] = "item"
string default[32] = "default"
string first_value[32] = "first-value"
string second_value[32] = "second-value"
string s[32]
fn = MakeTempName(GetTempPath())
if not WriteProfileStr(section, item, first_value, fn)
return ("Error on 1st WriteProfileStr()")
endif
s = GetProfileStr(section, item, default, fn)
if s <> first_value
return (Format("Expected: ", first_value, " but got: ", default))
endif
if not WriteProfileStr(section, item, second_value, fn)
return ("Error on 2nd WriteProfileStr()")
endif
s = GetProfileStr(section, item, default, fn)
if s <> second_value
return (Format("Expected: ", second_value, " but got: ", default))
endif
return ("")
end
proc main()
string s[255]
s = test_profile1() if s <> "" Warn(s) return () endif KeyPressed()
MsgBox("Passed")
end