If you need to express the size of a file in KB or MB as opposed to bytes, try the following :-
[color blue]
lnNo = ADIR(laFile,[C:\myApp\New App.exe])
IF lnNo = 1 [color green]&& File exists[color blue]
[tab]lcSize = Bytes2KB(laFile[2])
ENDI
IF lnKB > 999.99
[tab]RETURN TRANSFORM(CEILING(lnKB/1.024/1000),[999,999])+[ MB]
ELSE
[tab]RETURN TRANSFORM(CEILING(nValue/1.024/1000),[999,999])+[ KB]
ENDI
[color green]
*!* EOF
[color black]
Have fun
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.