Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2005.01.23;
Скачать: CL | DM;

Вниз

WIN32_FIND_DATA (большой размер файла)   Найти похожие ветки 

 
Sun bittern ©   (2005-01-04 20:05) [0]

Доброго вечера!

var
FSize: Int64;
WinFindData: PWin32FindData;

nFileSizeHigh
High-order DWORD value of the file size, in bytes. This value is zero unless the file size is greater than MAXDWORD. The size of the file is equal to (nFileSizeHigh * (MAXDWORD+1)) + nFileSizeLow.

Так не нравится:
FSize := (WinFindData^.nFileSizeHigh * (High(DWORD) + 1)) + WinFindData^.nFileSizeLow;

А так в самый раз:
FSize := (WinFindData^.nFileSizeHigh * High(DWORD)) + WinFindData^.nFileSizeLow;

Т.е. не дает мне единичку прибавить :( : MAXDWORD+1
Хотя High(Int64) корректно обрабатывается.

Можно конечено и так:
A := High(DWORD);
FSize := (WinFindData^.nFileSizeHigh * (A + 1)) + WinFindData^.nFileSizeLow;

Просто интересно стало, почему способ выше не канает?


 
ламер ©   (2005-01-04 20:17) [1]

может, (Int64(High(DWord)) + 1)?


 
begin...end ©   (2005-01-04 20:18) [2]

> Sun bittern ©   (04.01.05 20:05)
Дело в переполнении.

Попробуйте так:

FSize := (WinFindData^.nFileSizeHigh * (Int64(High(DWORD)) + 1)) + WinFindData^.nFileSizeLow


 
GuAV ©   (2005-01-04 20:19) [3]

Int64Rec(I).Hi
Int64Rec(I).Lo


 
Sun bittern ©   (2005-01-04 20:25) [4]

Int64(High(DWORD)) + 1

Ага так идет. Но ведь может ведь результат вернуть High(Int64) и почему с переполнением выпендривается? Проблема решена :)


 
begin...end ©   (2005-01-04 20:28) [5]

> [4] Sun bittern ©   (04.01.05 20:25)

> Но ведь может ведь результат вернуть High(Int64) и почему
> с переполнением выпендривается?

Не понял вопроса.


 
ламер ©   (2005-01-04 20:32) [6]

Sun bittern ©   (05.01.04 20:25) [4]

In general, arithmetic operations on integers return a value of type Integer—which, in its current implementation, is equivalent to the 32-bit Longint. Operations return a value of type Int64 only when performed on an Int64 operand.


 
Sun bittern ©   (2005-01-04 20:52) [7]

Теперь ясно :)



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

Текущий архив: 2005.01.23;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.026 c
14-1104773912
Aldor_
2005-01-03 20:38
2005.01.23
Обособление интерфейсной части в программе. Способы.


3-1103611773
alex145
2004-12-21 09:49
2005.01.23
Как импортировать dbf-таблицы


14-1105035969
Narik
2005-01-06 21:26
2005.01.23
Люди как поместить в RichEdit иконку или рисунок???


6-1099136025
Diaskhan
2004-10-30 15:33
2005.01.23
Ошибка в Win98 при определении IP-adressa


1-1105368371
ArchValentin
2005-01-10 17:46
2005.01.23
Создание хэлпов