SUB check4file (filename$,a%)
f%=FREEFILE
OPEN filename$ FOR APPEND AS #f%
IF LOF(f%)= 0 THEN a% = 0 ELSE a% = 1
CLOSE #f%
IF a% = 0 THEN KILL filename$
END SUB
MiggyD,
As the question was raised in this (BASIC:Microsoft) forum so it's not unreasonable to think that the questioner was dealing with one of the Microsoft Basic dialects.
Since QBasic predominates - for DOS platforms - it is most likely that the question referred to QBasic.
For my part, I was merely adding to Rathgar's comments by giving another QBasic solution.
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.