arrdio取文件列表

admin2021-10-28  2.9K+

fsys.getTempDir()    系统处理.取临时目录
fsys.enum()    文件_枚举EX
table.push()    数组操作.加入成员
winform.edit.text    编辑框.内容
winform.edit.printf()    编辑框.加入文本, 格式化文本A

import win.ui;
/*DSG{{*/
var winform = win.form(text="aardio form";right=360;bottom=422)
winform.add(
button={cls="button";text="Button";left=227;top=15;right=332;bottom=63;z=2};
edit={cls="edit";left=11;top=11;right=212;bottom=408;edge=1;multiline=1;z=1}
)
/*}}*/

import fsys;
winform.button.oncommand = function(id,event){
	winform.edit.text = "";
	var filenames = {};
	fsys.enum( fsys.getTempDir(), "*.tmp",
		function(dir,filename,fullpath,findData){ 
			if(filename){
				 table.push(filenames, filename);
	           	//winform.edit.printf('%s\n', filename)
	        }
		},
		false
	);
	for(i=1; #filenames;1){
		winform.edit.printf('%s\n', filenames[i])
	}
 
}

winform.show();
win.loopMessage();
return winform;
转载请注明原文地址: https://aardio.net/read-252.html
最新回复(0)
aardio问答
aardio编程语言