DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2005

    Formating File Sizes


    I need to know how to Format file sizes when they hit a certain point...

    I'm using FileLen to obtain the files size in bytes, but after hitting a certain point, the FileLen overflows.

    Heres my code:

    Dim i As Integer
    Dim file As Integer

    For i = 0 To File1.ListCount - 1
    file = FileLen(File1.Path & "\" & File1.List(i))
    List1.AddItem file & " bytes"

    Ive tried this...

    If file > 1024 Then
    file = Format$(FileLen(File1.Path & "\" & File1.List(i))
    End If

    But it doesn't seem to work

    Anybody have any ideas or can help?


  2. #2
    Join Date
    Jun 2005
    On a computer


    Try this...

    Dim I as long

    instead of an integer

    A Long is a 4 byte integer while an Integer is a 2 byte integer
    I'm a nobody...
    Nobody's Perfect, so I'm Perfect

Similar Threads

  1. wav file fade in out help
    By jase_dukerider in forum C++
    Replies: 2
    Last Post: 04-14-2005, 07:48 PM
  2. Help on Formating XML file ??
    By serge calderara in forum .NET
    Replies: 3
    Last Post: 04-12-2005, 01:10 PM
  3. How long before the next version??
    By _CAG in forum .NET
    Replies: 146
    Last Post: 08-12-2002, 10:40 PM
  4. File uploading / objFile.Write problem
    By Tomer Cagan in forum ASP.NET
    Replies: 1
    Last Post: 07-24-2001, 09:01 AM
  5. NullPointerException when reading text file
    By Andrew McLellan in forum Java
    Replies: 3
    Last Post: 05-09-2001, 05:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.