pro warn_file,state xcount = state.tra.ntracex + 1 if xcount gt 0 then begin widget_control,state.tra.outfile,get_value=file_tra unit2 = 2 result = ' ' state.tra.warn = 0 ON_IOERROR, warn_file openr,unit2,file_tra ;,/get_lun ; ; the file is still existed, asking if same file is replaced or not. ; warning = [ $ 'Warning message: ' , $ ' ', $ ' There is a file with the same name. ' , $ ' Do you want to replace it with the file? ' , $ ' All .dat files associated with the unsaved ' , $ ' .tra file will also be replaced. ' , $ ' No - exit then change name version number ' , $ ' ' ] result = dialog_message(warning,/QUESTION) if result eq 'Yes' then state.tra.warn = 1 if result eq 'No' then state.tra.warn = 2 warn_file: ; no file, go ahead to write new file if result ne 'No' then begin widget_control,state.lasttext,set_value=file_tra state.tra.trafile = file_tra endif close,unit2 endif return end