?GetSizeOnDisk(GETFILE(), 1) ************************************ FUNCTION GetSizeOnDisk(tcFileName, tnType) ************************************ * tnType = 0 for Bytes * tnType = 1 for KB * tnType = 2 for MB * tnType = 3 for GB ************************************ #DEFINE OF_READ 0 #DEFINE OF_SHARE_DENY_NONE 64 #DEFINE HFILE_ERROR -1 #DEFINE DWORDPLUS 4294967296 DECLARE INTEGER GetFileSize IN kernel32; INTEGER hFile,; INTEGER @ lpFileSizeHigh DECLARE INTEGER OpenFile IN kernel32; STRING lpFileName,; STRING @ lpReOpenBuff,; INTEGER wStyle DECLARE INTEGER CloseHandle IN kernel32 INTEGER hObject LOCAL lpReOpenBuff, hFile, lnSizeLo, lnSizeHi, lnReturn IF PCOUNT() < 2 tnType = 1 ENDIF IF TYPE("tcFileName") != "C" OR !FILE(tcFileName) lnReturn = 0 ELSE lpReOpenBuff = REPLI (Chr(0), 250) hFile = OpenFile (tcFileName, @lpReOpenBuff, OF_SHARE_DENY_NONE) IF hFile <> HFILE_ERROR lnSizeHi = 0 lnSizeLo = GetFileSize (hFile, @lnSizeHi) = CloseHandle (hFile) lnReturn = lnSizeHi * DWORDPLUS + lnSizeLo / 1024^tnType ELSE lnReturn = 0 ENDIF ENDIF RETURN lnReturn ENDFUNC>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.