#module
#deffunc savedlg str, str, int
mref extend, 32 : mref sup, 33 : mref option, 2
mref stt, 64
mref result, 65
dialog extend, 17, sup
if stat {
s = refstr : strlen i.0, s
s2 = extend : instr i.1, s2, ";" : strlen i.2, s2
if i.1 ! -1 : strmid s2, s2, 0, i.1
s2 = "." + s2
strmid s3, s, -1, i.2
if s3 ! s2 {
if option {
repeat i, 1
instr i.3, s, "\\", i - cnt : if i.3 ! -1 : break
instr i.3, s, ".", i - cnt : if i.3 ! -1 : i -= cnt : break
loop
strmid result, s, 0, i
result += s2
} else {
result = s + s2
}
}
}
return
#global
sdim buf, 1024
objsize winx / 2, 25
pos winx / 2 * 0, 0 : button "読み込む", *load
pos winx / 2 * 1, 0 : button "保存する", *save
pos 0 : mesbox buf, winx, winy - 25, 5
stop
*load
dialog "txt", 16, "読み込むファイル(1KBまで)"
if stat {
bload refstr, buf
objprm 2, buf
}
stop
*save
savedlg "txt", "保存するファイル名", 1
if stat : bsave refstr, buf
stop
|