View Single Post
  #5  
Old 04-01-2005, 01:24 PM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
Re: function that me controls the existence a file

There may be a better way, but some of our macros use logic like this to test for the existence of a file.
Code:
LET Test_file_name 'C:\my_file.txt'
TRAP_ERROR
OPEN_INFILE 1 Test_file_name END
IF (CHECK_ERROR) {file does not exist}
  OPEN_OUTFILE 1 Test_file_name 
  Commands...
ELSE {file exists}
  CLOSE_FILE 1
  Commands...
END_IF
__________________
John Scheffel
Reply With Quote