Вниз
Скачать: CL | DM;

Работа с файлами   Найти похожие ветки 

 
Виталик___   (2006-02-12 21:06) [0]

В директории ./Data есть несколько файлов с расширением *.us
Как мне создать массив sl[i], где i - кол-во файлов, а sl имеет тип string и равен имени файла.
Спасибо.


 
Чародей ©   (2006-02-12 22:21) [1]

procedure FindF(var List:TStrings; const Path: string);
var
 FPath:string;
 FindHandle:THandle;
 FindData:TWin32FindData;
begin
if Path="" then Exit;
FPath:=Path;
if FPath[Length(FPath)]<>"\" then
 FPath:=FPath+"\";
FindHandle := FindFirstFile("*.*", FindData);
if FindHandle <> INVALID_HANDLE_VALUE then
 repeat
     if (FindData.cFileName[0]<>".") then
       List.Append(FPath+FindData.cFileName);
 until not FindNextFile(FindHandle, FindData);
if FindHandle <> INVALID_HANDLE_VALUE then
 Windows.FindClose(FindHandle);
end;

Если очень надо то вместо List используй динамический массив



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.44 MB
Время: 0.029 c
2-1139491297
pathfinder
2006-02-09 16:21
2006.02.26
TMemo.


2-1139538368
Mozart
2006-02-10 05:26
2006.02.26
TMemo


1-1138117553
medvedenator
2006-01-24 18:45
2006.02.26
TaskBar


1-1138028544
Петр Громов
2006-01-23 18:02
2006.02.26
нужен сверхчастый вывод


6-1131999953
XRed
2005-11-14 23:25
2006.02.26
Интернет. Процесс передачи данных.




   Наверх