#uselib "kernel32.dll"
#cfunc global WritePrivateProfileString "WritePrivateProfileStringA" sptr, sptr, sptr, sptr
#module
#defcfunc setini str file, str section, str key, str value, local s
s = section, key, value, file
return WritePrivateProfileString(s.0, s.1, s.2, s.3)
#global
sdim string, 32, 3
string = "SectionName", "KeyName", "SaveData"
pos 10, 10 : mes "セクション"
pos 100, 10 : input string.0, 200, 20, 31
pos 10, 40 : mes "キー"
pos 100, 40 : input string.1, 200, 20, 31
pos 10, 70 : mes "データ"
pos 100, 70 : input string.2, 200, 20, 31
pos 10, 100 : mes "保存"
pos 100, 100 : button gosub "実行", *save
stop
*save
dialog "ini", 17, "保存INI名"
if stat {
if setini(refstr, string.0, string.1, string.2) = 0 {
dialog "正常に書き込めませんでした", 1
}
}
return
|