Bax*_*XTR 2 lotus-notes lotusscript lotus-domino
我正在尝试编写一个LS代理来扫描Windows中的目录,例如:'C:\'表示任何文件和子目录.对于每个子目录,它将进入并搜索更多文件和子目录并继续,直到找不到更多.我习惯于编写递归代码来替换或删除长字符串中的字符但是对于这个我完全迷失了.下面是我的代码(它是来自domino帮助文件的代码和我在IBM站点中找到的代码的混合):
Sub Initialize
Dim pathname As String, filename As String
pathname = "C:\*.*"
filename = Dir(pathname, 16)
Print "Begin scan"
Do While filename<>""
If IsDir(pathname+filename)=True Then
Print pathname+filename+" is a directory"
'look for more directories and files in here
Else
Print filename+" is a file"
End If
filename=Dir()
Loop
Print "Finish scan"
End Sub
Function IsDir(Path As String) As Integer
Dim Void&
Dim Result As Boolean
On Error GoTo ErrorHandler
Void=FileLen(Path)
Result=False
GoTo Over
ErrorHandler:
Result=True
Resume Over
Over:
IsDir=Result
End Function
Run Code Online (Sandbox Code Playgroud)
我需要更改什么才能使代码在注释部分递归?('在这里寻找更多目录和文件).我不仅仅是想找到一个特定的文件或目录.我想要所有可用的东西.如果我能够这样做,那么我可以检索它们并保存到NotesDocument中.
| 归档时间: |
|
| 查看次数: |
3916 次 |
| 最近记录: |