【vfp开源代码栏目提醒】:网学会员在vfp开源代码频道为大家收集整理了sendnewdircursortoscreenasnormal.prg提供大家参考,希望对大家有所帮助!
CLEAR
LOCAL OldDepth,cSubDirectory,cFile
SELECT NewDirCursor
GO TOP
OldDepth=0
cSubDirectory=""
DO WHILE NOT EOF()
IF Depth>OldDepth AND File=0 &&增加子目录
cSubDirectory=cSubDirectory+;
ALLTRIM(STRTRAN(Subdirectory,CHR(0),""))+"\"
ENDIF
IF Depth<OldDepth &&减少目录深度
cSubDirectory=SUBSTR(cSubDirectory,1,;
RAT("\",cSubDirectory,OldDepth-Depth+1))
ENDIF
IF File=1 &&如果是文件
cFile=cSubDirectory+;
ALLTRIM(STRTRAN(Subdirectory,CHR(0),""))
ELSE
cFile=cSubDirectory
ENDIF
?cFile
OldDepth=Depth
SKIP
ENDDO