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:
01019411
Views:
19
This message has been marked as a message which has helped to the initial question of the thread.
Hi Neil,

The program below is comparing strings and you need to compare numeric values.

The TRANSFORM() command takes any data type and returns a string, hence your need to add quotes around 500000. Change this line:
IF transform(loFile.Size)<='500000'
to
IF loFile.Size <= 500000
and it will compare both sides as numeric and give you the answer you require.


I have used the following function but I keep getting the Messagebox stating It is not OK when my file is only 79KB. Any ides?


loFSO = Createobject("Scripting.FileSystemObject")
filepath = 'U:\questpdm\picture\whatever.jpg'
loFile = loFSO.Getfile(filePath)

IF transform(loFile.Size)<='500000'
MESSAGEBOX("File Size is OK")
ELSE
MESSAGEBOX("File Size is not OK")
ENDIF
I should be getting the message "File Size is OK"
Neil Lewis
IT R&D Manager
Velmore Ltd
Previous
Reply
Map
View

Click here to load this message in the networking platform