level 1
你代码中间是不是有Unicode的字符,比如(,等?Unicode的字符看起来像普通字符,但是MFP引擎不认。
2016年12月23日 10点12分
2
我用的是示例函数。
2016年12月23日 10点12分
@喂wswswsws 字串用了半角引号否?如:"你好吗?not yet."
2016年12月23日 21点12分
level 12
Help
@language:
test writing text file
@end
@language:simplified_chinese
测试写入文本文件
@end
endh
function writeTextFile()
// first test write to replace mode. If file does not exist, it will be
// created. If file does exist, its content will be wiped off.
// 首先测试写模式。如果要打开的文件不存在,那么它将会被创建。如果文件已经
// 存在,它的原有的内容将会被新写入的内容所覆盖。
variable fd = fopen("scripts/manual/io and file libs/test_write.txt", _
"w", "UTF-8")
// first inputs some numbers and string with prompt information
// 首先输入一些数字和字符(包括一些提示信息)
fprintf(fd, "The first line includes %d, %f, %s\n", 123.71, 56.48, "hi")
// then input 4 Chinese characters with prompt information
// 然后输入四个汉字(包括一些提示信息)
fprintf(fd, "Now input some Chinese characters: " + "汉字中文\n")
fclose(fd) // close the file(关闭文件)
// Then test append mode. If file does not exist, it will be
// created. If file does exist, fprintf will append some text to its
// current content.
// 然后测试添加模式。如果要打开的文件不存在,那么它将会被创建。如果文件
// 已经存在,将在它的原有的内容后添加新的内容。
fd = fopen("scripts/manual/io and file libs/test_write.txt", _
"a", "UTF-8")
// inputs some numbers and string with prompt information
// 输入一些数字和字符(包括一些提示信息)
fprintf(fd, "Now add a new line %d, %f, %s\n", -999, -48.73, "why?")
fclose(fd) // close the file(关闭文件)
endf
2016年12月24日 05点12分
7