图1原函数内容图2要执行函数文
mfp吧
全部回复
仅看楼主
level 13
图1原函数内容
图2要执行函数文件
图3要执行函数内容
图4运行结果
2016年10月18日 12点10分 1
level 13
2016年10月18日 13点10分 2
数参⇒#
2016年10月18日 13点10分
level 13
2016年10月18日 13点10分 3
文参⇒@
2016年10月18日 13点10分
level 13
2016年10月18日 16点10分 4
level 1
运行好像一切正常
2016年10月18日 19点10分 5
[真棒]嗯,加油
2016年10月19日 00点10分
level 13
help
@language:simplified_chinese
//例str="my_func,myf"⇒默认的mfps文件夹"/storage/emulated/0/AnMath/scripts/"
@end
endh
function add_all_mfps_to_cs(str)
variable str_path="/storage/emulated/0/AnMath/scripts/"
variable path=str_path+split(str,",")[0]
variable new_path=str_path+"cs_"+split(str,",")[0]
variable csname=split(str,",")[1]
if(ls("temp")==1)
f_qk("temp")
else
f_xj("temp")
endif
variable list=list_files(path)
for variable k=0 to size(list)[0]-1
if(strsub(list[k],strlen(list[k])-5,strlen(list[k]))==".mfps")
f_storage_f("temp",list[k])
endif
next
variable fp=fopen("temp","r","utf_8")
do
variable str=freadline(fp)
variable fo=fopen(path+"/"+str,"r","utf_8")
variable fo1=fopen(new_path+"/"+str,"w","utf_8")
//fprintf(fo1,"%s\n\n","citingspace ::func")
fprintf(fo1,"%s\n\n","citingspace ::"+csname)
do
variable st=freadline(fo)
fprintf(fo1,"%s\n",st)
until(feof(fo))
fprintf(fo1,"\n%s","endcs")
fclose(fo1)
fclose(fo)
until(feof(fp))
fclose(fp)
//f_gm(new_path,path)
endf
2016年10月25日 09点10分 8
split函数整合参数成一个字符串,原参数为字符串时不改,有数值时在程序中用evaluate函数转换
2016年10月25日 09点10分
1