DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2005
    Posts
    55

    Formating File Sizes

    Hello,

    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?

    Thanks

  2. #2
    Join Date
    Jun 2005
    Location
    On a computer
    Posts
    4

    Lightbulb

    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

Bookmarks

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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links