HSPでサブディレクトリ付きdirしたかったガラクタ

投棄

投棄

  • タグ:
  • タグはありません
#runtime "hsp3cl"
#cmpopt varinit 1

#module @dir
	#const fileOnly 1
	#const dirOnly 5
	#defcfunc local dir str path,str ptn,str addpath,str _filesN,local files
		filesN=_filesN
		dirlist files,path+ptn,fileOnly
		split files,"\n",files
		foreach files
			if files.cnt="": break
			if filesN!="": filesN+="\n"
			filesN+=addpath+"\\"+files.cnt
		loop

		sdim files
		dirlist files,path+ptn,dirOnly
		split files,"\n",files
		foreach files
			if files.cnt="": break
			if filesN!="": filesN+="\n"
			filesN+=dir(path+files.cnt+"\\",ptn,addpath+"\\"+files.cnt,filesN)
		loop
	return filesN
	#define global ctype dir(%1,%2="*",%3="",%4="") dir@@dir(%1,%2,%3,%4)
#global

mes dir("C:\\hsp35\\")