Dir Function

ཕྱིར་ལོག་གམ་གཏན་འཁེལ་བའི་བརྩད་འཚོལ་བརྒྱུད་ལམ་དང་ཟླ་སྒྲིག་པའི་སྒུལ་ཆས་སམ་དཀར་ཆག་གི་ཡིག་ཆ་ཞིག་གམ་དཀར་ཆག་གཅིག་གམ་ཡིག་ཆ་ཡོད་ཚད་དང་དཀར་ཆག་གི་མིང་ངོ་།

བརྡ་འཕྲོད་

Dir [(Text As String) [, Attrib As Integer]]

ཕྱིར་ལོག་ཐང་

ཡིག་རྟགས་ཕྲེང་བ་

ཁུགས་གྲངས་

Text གཏན་འཁེལ་བའི་བཤེར་འཚོལ་བརྒྱུད་ལམ་ དཀར་ཆག་གམ་ཡིག་ཆའི་ཡིག་རྟགས་ཕྲེང་བའི་མཚོན་ཚུལ་ལ་སྤྱོད། ཐེངས་དང་པོ་ཁོ་ནར་ Dir རྟེན་གྲངས་ཁོལ་སྤྱོད་བྱེད་དུས་རང་འགྱུར་འདི་གཏན་འཁེལ་བྱེད། གལ་ཏེ་དགོས་མཁོ་ཡོད་ན་ URL མཚོན་ཐབས་བརྒྱུད་ལམ་ནང་འཇུག་ཀྱང་སྤྱད་ཆོག་

Attrib གནས་ས་གཞིགས་པའི་ཡིག་ཆའི་གཏོགས་གཤིས་གཏན་འཁེལ་ལ་སྤྱོད་པའི་ཧྲིལ་གྲངས་གང་རུང་གི་མཚོན་ཚུལ། Dir རྟེན་གྲངས་ཀྱིས་གཏན་འཁེལ་གཏོགས་གཤིས་ཕན་ཚུན་ཟླ་སྒྲིག་པའི་ཡིག་ཆའམ་དཀར་ཆག་ཁོ་ན་ཕྱིར་ལོག་བྱེད། གཏོགས་གཤིས་ཐང་ཕན་ཚུན་བསྡོམས་པ་བརྒྱུད་ གཏོགས་གཤིས་མང་པོ་ཚོ་སྒྲིག་བྱེད་ཐུབ་

0 སྤྱིར་བཏང་གི་ཡིག་ཆ།

16 དཀར་ཆག་གི་མིང་ཁོ་ན་ཕྱིར་ལོག་བྱེད།

གཏོགས་གཤིས་འདི་སྤྱད་ནས་ཡིག་ཆའམ་དཀར་ཆག་གནས་ཡོད་མེད་བརྟག་དཔྱད་བྱེད་པའམ་གཏན་འཁེལ་དཀར་ཆག་འོག་གི་ཡིག་ཆ་དང་ཡིག་ཁུག་ཡོད་ཚད་གཏན་འཁེལ་བྱེད།

ཡིག་ཆ་བསྡད་ཡོད་མེད་བརྟག་དཔྱད་བྱེད་ན་འཐུས་ཚང་གི་ཡིག་ཆའི་བརྒྱུད་ལམ་དང་མིང་ནང་འཇུག་གྱིས། གལ་ཏེ་ཡིག་ཆ་དང་དཀར་ཆག་གི་མིང་བསྡད་མེད་ན་ Dir རྟེན་གྲངས་ཀྱིས་རིང་ཚད་ཀླད་ཀོར་ཀྱི་ཡིག་རྟགས་ཕྲེང་བ་ཕྱིར་ལོག་བྱེད་དོ། ("")

To generate a list of all existing files in a specific directory, proceed as follows: The first time you call the Dir function, specify the complete search path for the files, for example, "D:\Files\*.ods". If the path is correct and the search finds at least one file, the Dir function returns the name of the first file that matches the search path. To return additional file names that match the path, call Dir again, but with no arguments.

To return directories only, use the attribute parameter. The same applies if you want to determine the name of a volume (for example, a hard drive partition).

Error codes:

5 ནུས་མེད་ཀྱི་བརྒྱུད་རིམ་འཁོར་སྤྱོད་

53 ཡིག་ཆ་འཚོལ་མི་ཐུབ་པ་53 ཡིག་ཆ་འཚོལ་མི་ཐུབ་པ་53 ཡིག་ཆ་འཚོལ་མི་ཐུབ་པ་53 ཡིག་ཆ་འཚོལ་མི་ཐུབ་པ་53 ཡིག་ཆ་འཚོལ་མི་ཐུབ་པ་53 ཡིག་ཆ་འཚོལ་མི་ཐུབ་པ་

དཔེ་གཞི་

Sub ExampleDir

REM ཡིག་ཆ་དང་དཀར་ཆག་ཡོད་ཚད་མངོན་

Dim sPath As String

Dim sDir As String, sValue As String

    sDir="Directories:"

    sPath = CurDir

    sValue = Dir$(sPath + getPathSeparator + "*",16)

    Do

        If sValue <> "." And sValue <> ".." Then

            If (GetAttr( sPath + getPathSeparator + sValue) And 16) >0 Then

                REM དཀར་ཆག་ཐོབ་པ་

                sDir = sDir & chr(13) & sValue

            End If

        End If

        sValue = Dir$

    Loop Until sValue = ""

    MsgBox sDir,0,sPath

End Sub