Those are actually the same number.
?hex$(-1347188508) 'gives you...
AFB388E4 'plug this into Windows Calculator and you get....
2,947,778,788

Signature
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep it in the groups..
> I'm having a problem getting the size of a file.
> For a "small" file it all works fine.However for a file of over 2gb it gives
[quoted text clipped - 3 lines]
>
> And the file itself has a size of 2,947,778,788
OK but how to get this into the 2947778788 value?
> Those are actually the same number.
>
[quoted text clipped - 13 lines]
> >
> > And the file itself has a size of 2,947,778,788
Rick Rothstein - 30 Sep 2003 19:41 GMT
This should work...
BigNum = -1347188508
If BigNum < 0 Then
BigNum = 4294967296 + BigNum
End If
Rick - MVP
> OK but how to get this into the 2947778788 value?
>
[quoted text clipped - 18 lines]
> > >
> > > And the file itself has a size of 2,947,778,788
Ken Halter - 30 Sep 2003 20:16 GMT
Yup... much shorter than mine...
Dim BigNum As Double

Signature
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep it in the groups..
> This should work...
>
[quoted text clipped - 27 lines]
> > > >
> > > > And the file itself has a size of 2,947,778,788
Rick Rothstein - 30 Sep 2003 20:52 GMT
I wanted to make that If-Then statement a one-liner, but I was afraid of
that news reader line wrapping would have ruined the effect.<g>
Rick - MVP
> Yup... much shorter than mine...
>
[quoted text clipped - 31 lines]
> > > > >
> > > > > And the file itself has a size of 2,947,778,788
Dirk - 30 Sep 2003 20:34 GMT
seems to work that way....
Dim WFD As WIN32_FIND_DATA
Dim hFile As Long
Dim hTotalSize As Long
Dim tGetFileSize As Currency
hFile = FindFirstFile(filePath, WFD)
If hFile <> INVALID_HANDLE_VALUE Then
tGetFileSize = (WFD.nFileSizeHigh * 4294967296#) +
IIf(WFD.nFileSizeLow < 0, 4294967296# + WFD.nFileSizeLow, WFD.nFileSizeLow)
Else
tGetFileSize = -1
End If
GetFileSize = tGetFileSize
> This should work...
>
[quoted text clipped - 27 lines]
> > > >
> > > > And the file itself has a size of 2,947,778,788
Ken Halter - 30 Sep 2003 20:09 GMT
Here's one way.... just whipped it up so test with several values...
'============
Option Explicit
Private Function Normalize(SomeVal As Long) As Double
Dim sHex As String
If SomeVal < 0 Then
sHex = Right$("0000000" & Hex$(SomeVal), 8)
Normalize = Val("&h" & Left$(sHex, 4) & "&") * 65536 _
+ Val("&h" & Mid$(sHex, 5) & "&")
Else
Normalize = SomeVal
End If
End Function
Private Sub Command1_Click()
Dim d As Double
d = Normalize(-1347188508)
Debug.Print d 'shows 2947778788
End Sub
'============

Signature
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep it in the groups..
> OK but how to get this into the 2947778788 value?
>
[quoted text clipped - 18 lines]
> > >
> > > And the file itself has a size of 2,947,778,788