Question See if a file is present in a folder.

WayneFrank

Member
I need a way, from a Progress program to see if a file is in a folder. I have the complete path and filename. How do I do this?

Thanks.

frm_filename has the complete path and filename.

CREATE "Word.Application" chWordApp.
chWordApp:ScreenUpdating = TRUE.
chWordApp:visible = TRUE.
chWordApp:displayAlerts = NO.
chDoc = chWordApp:documents:OPEN(frm_filename,,YES,FALSE).

If the file is not present if gives an error
Error occurred while accessing component property/method:OPEN
Ths file could not be found
Error Code 0x80020009 Programname (5890)


Progress Vers 9
Windows 7
 
Code:
file-info:file-name = frm_filename.
if file-info:full-pathname = ? then
  message "oops!".
 else
  do:
    /* whatever... */
  end.
 
Back
Top