Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining file size
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01019302
Message ID:
01019313
Views:
21
How can i programmatically determine the size of a file in KB? I want to pass a file as a parameter and determine the size. If the size is below 500KB do this if greater then do that.
>
>Many Thanks


Neil try this
CLOSE DATABASES
SET DEFAULT TO (HOME(2) + 'Data')

m.NumTables = ADIR(MyTables, '*.DBF')  && Create array

FOR m.nCount = 1 TO m.NumTables && Loop for number of tables
    MESSAGEBOX(IIF(MyTables(m.nCount,2)<=50000,'Less or equal 50KB','greater then 50 KB')+ '  size = '+TRANSFORM(MyTables(m.nCount,2))+' bytes')
ENDFOR
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Previous
Reply
Map
View

Click here to load this message in the networking platform