Date: Thu, 28 Mar 2024 09:30:47 -0700 (PDT) Message-ID: <492964121.245.1711643447782@wiki.srpcs.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_244_529679563.1711643447782" ------=_Part_244_529679563.1711643447782 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Returns a list of filenames from a directory and mask specified in a pre= vious InitDir statement. The mask is used to create a selection of file nam= es, using the standard DOS wildcards "*" and "?".
filenames =3D DirList()
The DirList function returns a dynamic array of the operating system fil= enames found in the directory masked by the InitDir statement.
With each use of DirList(), a list of filenames will be returned from th= e specified directory. DirList() may be placed in a loop to obtain all the = filenames in a large directory. The loop would continue until the list is e= mpty. Filenames are separated by field marks (ASCII character 254).
Drive(), SetInitDirOptions,&= nbsp;InitDir
/* Looks at each f= ile in the C:\WINDOWS directory. Variable AB_COUNT keeps a count of the number of files with names starting = with "A" or "B". */ InitDir "C:\WINDOWS\*.*" AB_COUNT =3D 0 files =3D DirList() position =3D 1 flag =3D "" Loop Remove this_file From files At position Setting flag first_letter =3D this_file[1,1] if first_letter _eqc "a" or first_letter _eqc "b" then AB_COUNT +=3D 1 end While flag Repeat call msg(@window,"There are " : AB_COUNT : " files in the directo= ry starting with an A or B.")