3 <title>KOL Help: TDirList object (main frame)
</title>
7 <body bgcolor=
"#FFFFEF" text=
"#000000" link=
"#008080" vlink=
"#008000" alink=
"#808000">
8 <p><font face=
"Courier" color=
"#800080"><b>TDirList( unit
<a href=kol_pas.htm
>KOL.pas
</a> )
9 <font face=
"Wingdings">ï
</font> <a href=tobj.htm
>TObj
</a>
10 <font face=
"Wingdings">ï
</font> <a href=_tobj.htm
>_TObj
</a>
13 TDirList = object(
<a href=tobj.htm
target=
"_top">TObj
</a> )
15 Allows easy directory scanning. This is not visual object, but
16 storage to simplify working with directory content.
17 <h3 align=
"center"><font color=
"#FF8080">TDirList properties
</font></h3>
20 <font face=
"Courier" color=
"#800080"><b>property
</b> <font color=
"#808000"><b>Items
</b></font>[ Idx:
<b>Integer
</b> ]: PWin32FindData;
<b>default
</b>;
</font>
21 <font face=
"Webdings" size=
7>Ñ</font>
23 Full access to scanned items (files and subdirectories).
25 <a name=
"isdirectory"></a>
27 <font face=
"Courier" color=
"#800080"><b>property
</b> <font color=
"#808000"><b>IsDirectory
</b></font>[ Idx:
<b>Integer
</b> ]:
<b>Boolean
</b>;
</font>
28 <font face=
"Webdings" size=
7>Ñ</font>
30 Returns TRUE, if specified item represents a directory, not a file.
34 <font face=
"Courier" color=
"#800080"><b>property
</b> <font color=
"#808000"><b>Count
</b></font>:
<b>Integer
</b>;
</font>
35 <font face=
"Webdings" size=
7>Ñ</font>
41 <font face=
"Courier" color=
"#800080"><b>property
</b> <font color=
"#808000"><b>Names
</b></font>[ Idx:
<b>Integer
</b> ]:
<b>string
</b>;
</font>
42 <font face=
"Webdings" size=
7>Ñ</font>
44 Full long names of directory items.
48 <font face=
"Courier" color=
"#800080"><b>property
</b> <font color=
"#808000"><b>Path
</b></font>:
<b>string
</b>;
</font>
49 <font face=
"Webdings" size=
7>Ñ</font>
51 Path of scanned directory.
53 <h4 align=
"center"><font color=
"black">Properties, inherited from
<a href=
"tobj.htm" target=
"_top">TObj
</a></font></h4>
54 <h3 align=
"center"><font color=
"#FF8080">TDirList methods
</font></h3>
55 <a name=
"destroy"></a>
57 <font face=
"Courier" color=
"#800080"><b>destructor
</b> <font color=
"#808000"><b>Destroy
</b></font>;
<b>virtual
</b>;
</font>
58 <font face=
"Webdings" size=
7>N</font>
60 Destructor. As usual, call
<a href=#free
target=
"main">Free
</a> method to destroy an object.
64 <font face=
"Courier" color=
"#800080"><b>procedure
</b> <font color=
"#808000"><b>Clear
</b></font>;
</font>
66 Call it to clear list of files.
68 <a name=
"scandirectory"></a>
70 <font face=
"Courier" color=
"#800080"><b>procedure
</b> <font color=
"#808000"><b>ScanDirectory
</b></font>(
<b>const
</b> DirPath, Filter:
<b>String
</b>; Attr:
<b>DWord
</b> );
</font>
72 Call it to rescan directory or to scan another directory content
73 (method
<a href=#clear
target=
"main">Clear
</a> is called first). Pass path to directory, file filter
74 and attributes to scan directory immediately.
75 <br>
76 Note: Pass FILE_ATTRIBUTE_... constants or-combination as Attr
77 parameter. If
0 passed, both files and directories are listed.
79 <a name=
"scandirectoryex"></a>
81 <font face=
"Courier" color=
"#800080"><b>procedure
</b> <font color=
"#808000"><b>ScanDirectoryEx
</b></font>(
<b>const
</b> DirPath, Filters:
<b>String
</b>; Attr:
<b>DWord
</b> );
</font>
83 Call it to rescan directory or to scan another directory content
84 (method
<a href=#clear
target=
"main">Clear
</a> is called first). Pass path to directory, file filter
85 and attributes to scan directory immediately.
86 <br>
87 Note: Pass FILE_ATTRIBUTE_... constants or-combination as Attr
92 <font face=
"Courier" color=
"#800080"><b>procedure
</b> <font color=
"#808000"><b>Sort
</b></font>( Rules:
<b>array
</b> <b>of
</b> <a href=kol_pas.htm#tsortdirrules
target=
"_top">TSortDirRules
</a> );
</font>
94 Sorts directory entries. If empty rules array passed, default rules
95 array
<a href=kol_pas.htm#defsortdirrules
target=
"_top">DefSortDirRules
</a> is used.
97 <a name=
"filelist"></a>
99 <font face=
"Courier" color=
"#800080"><b>function
</b> <font color=
"#808000"><b>FileList
</b></font>(
<b>const
</b> Separator:
<b>String
</b>; Dirs, FullPaths:
<b>Boolean
</b> ):
<b>String
</b>;
</font>
101 Returns a string containing all names separated with Separator.
102 If Dirs=FALSE, only files are returned.
104 <h4 align=
"center"><font color=
"black">Methods, inherited from
<a href=
"tobj.htm" target=
"_top">TObj
</a></font></h4>
105 <h3 align=
"center"><font color=
"#FF8080">TDirList events
</font></h3>
106 <a name=
"onitem"></a>
108 <font face=
"Courier" color=
"#800080"><b>property
</b> <font color=
"#808000"><b>OnItem
</b></font>: TOnDirItem;
</font>
110 This event is called on reading each item while scanning directory.
111 To use it, first create PDirList object with empty path to scan, then
112 assign OnItem event and call
<a href=#scandirectory
target=
"main">ScanDirectory
</a> with correct path.
114 <h4 align=
"center"><font color=
"black">Events, inherited from
<a href=
"tobj.htm" target=
"_top">TObj
</a></font></h4>
115 <h3 align=
"center"><font color=
"#FF8080">TDirList fields
</font></h3>
116 <h4 align=
"center"><font color=
"black">Fields, inherited from
<a href=
"tobj.htm" target=
"_top">TObj
</a></font></h4>
118 <p align=
"center">[
<a href=index.htm
>Index
</a> ]
</p>
119 <p align=
"center"><font face=
"Comic Sans MS"><small>This help is generated
22-Sep-
2005 by KOL Help generator, (C)
2000-
2001 by Vladimir Kladov
<br>Modified (C)
2003 by Alexander Bartov
</small></font></p>