[问题] aw中如何动态的判断某文件夹下文件的格式,并使之的值返回到一组字符串中?
[解答] (Rock Studio 魔岩工作室、AW5 、虚竹)
--取得文件列表
FileString:=Catalog(FileLocation,"F")
--取得文件个数
FileNumber:=LineCount(FileString,Return)
--初始化文件后缀名记录字符串
FileFixs:=""
--取得总的文件后缀名
repeat with i:=1 to FileNumber
FileNames:=GetLine(FileString,i)
lastindex:=CharCount(FileNames)
FileFix:=SubStr(FileNames,RFind(".",FileNames)+1,CharCount(FileNames))
FileFixs:=FileFixs^FileFix^Return
end repeat
--筛选后缀名
FixsNumber:=LineCount(FileFixs)
repeat with k:=0 to FixsNumber
str:=LowerCase(GetLine(FileFixs,k))
str3:=str3^str
str1:=LowerCase(GetLine(FileFixs,k+1))
if Find(str1,str3)=0 then
fixs:=fixs^str1^Return
end if
end repeat
范例下载:
判断文件后缀名8K