为什么没有结果?
mfp吧
全部回复
仅看楼主
level 12
喂wswswsws 楼主
2016年12月23日 06点12分 1
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 13
2016年12月24日 04点12分 4
把你写的源码贴出来@喂wswswsws
2016年12月24日 05点12分
level 13
2016年12月24日 05点12分 5
就是mfp自带的示例程序。
2016年12月24日 05点12分
@喂wswswsws 我这显示不存在啊(false)
2016年12月24日 05点12分
你只要拷贝示例程序就可以了。
2016年12月24日 05点12分
明白了这个函数如果要写入文本的话只能在代码中进行。代码里面并没有读取用户输入然后保存的功能。
2016年12月24日 05点12分
level 12
喂wswswsws 楼主
2016年12月24日 05点12分 6
level 12
喂wswswsws 楼主
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
level 13
2016年12月24日 06点12分 9
赞![真棒] 你是怎么识别输入的字符啊?那个“←”是怎么识别的?
2016年12月24日 08点12分
刚才忘了看代码了,知道怎么识别的了。[黑线]
2016年12月24日 08点12分
1