Files
tools/接口/文件读写方法.ms
T
2025-07-31 16:05:55 +08:00

50 lines
561 B
Plaintext

/*
a=createfile "C:\Users\ab\Desktop\\test.txt"
b=10
print 5 to:a
format "%,%\n" 1 2 to:a
print b to:a
format "%,%\n" 3 4 to:a
close a
free a
*/
openf=openfile "C:\Users\ab\Desktop\\test.txt"
if openf !=undefined then
(
i=readValue openf
j=readline openf
k=readValue openf
format "filepos=%\n" (filepos openf)
seek openf 0
l=readValue openf
m=readValue openf
format "i=%\n" i
format "j=%\n" j
format "k=%\n" k
format "l=%\n" l
format "m=%\n" m
format "\n\n"
print j
eof openf
flush openf
)
free openf
close openf