Click to See Complete Forum and Search --> : What is the meaning of & and @ when they are attached to variables


vamsi
April 16th, 2001, 05:12 PM
What is the meaning of & and @ when they are attached to variables? Below is the example.

Dim SectorsPerCluster&, BytesPerSector&
Dim FreeBytesAvailable@, TotalBytes@

Thanks in Advance,
Vamsi

cksiow
April 16th, 2001, 07:10 PM
& mean that the variable is long
same as it is
dim SectorsPerCluster as long

and @ should be currency, if I am not wrong, but looking at ur codes, it has to do with some disk operation, which is strange to use currency variable.

cksiow
http://vblib.virtualave.net - share our codes

John G Duffy
April 17th, 2001, 08:35 AM
His little sample appears to be from a GetFreeSpaceAsCurrency sample I found a while back
The Existing disk API "GetFreeSpace" is limited in the fact it can not report space greater than 2.x Gig making it useless with most current disk drives.
The following example uses the GetFreeSpaceASCurrency API to overcome this restriction. Note the use of Currency in the API.

option Explicit

private Declare Function GetDiskFreeSpaceExAsCurrency Lib "kernel32" Alias "GetDiskFreeSpaceExA" _
(byval lpDirectoryName as string, _
lpFreeBytesAvailableToCaller as Currency, _
lpTotalNumberOfBytes as Currency, _
lpTotalNumberOfFreeBytes as Currency) as Long 'C Bool
public Function Getspace(spath, Index)
Dim BytesAvailable as Currency
Dim TotalBytes as Currency
Dim TotalFreeBytes as Currency
Dim tmp as Currency

Call GetDiskFreeSpaceExAsCurrency(spath, BytesAvailable, TotalBytes, TotalFreeBytes)
Select Case Index
Case 1
Getspace = CStr(BytesAvailable * 10000)
Case 2
Getspace = CStr(TotalBytes * 10000)
End Select

End Function


private Sub Command1_Click()
MsgBox (Format(Getspace(Text1.Text, 1), "###,###,###,###") _
& vbCrLf & _
Format(Getspace(Text1.Text, 2), "###,###,###,###"))
End Sub




John G