The FILE() function can have some unexpected behavior as it will also search
the VFP path. If for some reason you had the same file in a different location
it will still return .T. You may want to do something like obtain a file handle
to m.cFile before you try to delete it. And I would probably wrap the whole
thing in a TRY..CATCH.
Untested Pseudo-code alert
m.nHandle=FOPEN(m.cFile)
IF m.nHandle<>0
FCLOSE(m.nHandle)
ERASE (m.cFile)
ENDIF
--
rk
-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Richard Kaye
Sent: Wednesday, April 23, 2014 1:17 PM
To: [email protected]
Subject: RE: HELP!!! I'm getting old.. What is wrong with this file code?
IF FILE(m.cFile)
--
rk
-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Michael
Savage
Sent: Wednesday, April 23, 2014 1:16 PM
To: [email protected]
Subject: HELP!!! I'm getting old.. What is wrong with this file code?
cFile=curdir()+"BCDE\"+"CUSTOMER.TXT"
which translates to:
C:\VFP9APPS\ACTIVE\WTL\BCDE\CUSTOMER.TXT
if (cFile)
At this line - error is data type mismatch...
The file is there. I need to erase it prior to proceeding.
What have I forgotten to do?
Thanks,
Mike
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/DF1EEF11E586A64FB54A97F22A8BD04423922EE6AB@ACKBWDDQH1.artfact.local
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.