Модуль "P2KFileManager" (часть 11) - AddFileToList
последняя версия: 3.0.9 build 961 beta
от 07 декабря 2007 г.
от 07 декабря 2007 г.
function TfrmP2KFileManager.AddFileToList(AFile: string; ASize: integer): boolean; var tmpMotoFiles: TMOtoFileList; i: integer; IsFound: boolean; str: string; cnt: integer; begin result:= false; IsFound:= false;
//for i:=0 to High(AMotoFiles) do for i:=0 to High(xMotoFiles)-1 do //if AMotoFiles[i].Name = AFile then begin if xMotoFiles[i].Name = AFile then begin IsFound:= true; //AMotoFiles[i].Size:= ASize; xMotoFiles[i].Size:= ASize; //AMotoFiles[i].Attr:= 0; xMotoFiles[i].Attr:= 0; break; end; if IsFound then exit; //tmpMotoFiles:= AMotoFiles; tmpMotoFiles:= xMotoFiles; // cnt:= High(tmpMotoFiles) + 1; cnt:= High(tmpMotoFiles) + 2; //SetLength(AMotoFiles, cnt); SetLength(xMotoFiles, cnt); for i:=0 to High(tmpMotoFiles) do begin //AMotoFiles[i]:= tmpMotoFiles[i]; xMotoFiles[i]:= tmpMotoFiles[i]; end; //CopyMemory(@AMotoFiles[i].Name, PChar(AFile), length(AFile)); CopyMemory(@xMotoFiles[i].Name, PChar(AFile), length(AFile)); str:= AFile; str:= ExtractFileExt(str); if (str <> '') and (str[1] = '.') then Delete(str, 1, 1); //CopyMemory(@AMotoFiles[i].Ext, PChar(str), length(str)); CopyMemory(@xMotoFiles[i].Ext, PChar(str), length(str)); //AMotoFiles[i].Size:= ASize; xMotoFiles[i].Size:= ASize; //AMotoFiles[i].Attr:= 0; xMotoFiles[i].Attr:= 0; result:= true; end;
Еще записи по теме
- Модуль "Стили звонка" (часть 4) - CompareMelody
- Модуль "P2KApi" (часть 54) - TP2KAPI.FlashCmd3
- Модуль "АТ-команды" (часть 11) - GetModel_AT
- Модуль "Справочник" (часть 2) - определение переменных и типов данных
- Модуль "P2KFileManager" (часть 17) - DeleteMotoFolder
- Модуль "Будильник" (часть 2)
- Модуль "P2KApi" (часть 21) - TP2KAPI.SendCommand05
