Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determining file size
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01019302
Message ID:
01019411
Vues:
20
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform