>When I get out from LOCFILE() window by "Cancel" open an error window: "File does not exist." "Cancel, Suspend, Ignore". This is not good for users. How can I manage this situation in my program?
>(VFP 9.0)
I think you should use getfile() instead of locfile(). This one gives you an empty return value if the user cancels.
Here is some sample code; change the extension and commands for other file types:
local lcFile
lcFile = getfile("DBF")
if not empty(lcFile)
use (lcFile)
browse normal
endif
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)