CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2000
    Location
    Houston, Tx, USA.
    Posts
    25

    What is the meaning of & and @ when they are attached to variables

    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


  2. #2
    Join Date
    Apr 2000
    Posts
    737

    Re: What is the meaning of & and @ when they are attached to variables

    & 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


  3. #3
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: What is the meaning of & and @ when they are attached to variables

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured