DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatically overwrite file with DataFileSave

Hi everybody,

I have made a script which loads a certain TDM file and uses it as a database.

The script modifies the TDM and then saves the TDM file again by using DataFileSave.

 

Since the filename and path are the same, Diadem asks in a pop-up window if it can
overwrite this data. Is there a way to give the command to Diadam to automatically
overwrite the original file without this annoying pop-up?

 

With kind regards,

Darthy

0 Kudos
Message 1 of 3
(4,704 Views)

In the meantime I have found a solution to my problem.

It might not be the most elegant one but it works.

When you put "CmdNoWarningDisp=True" before the DataFileSave command, the warning pop-up message doesn't appear anymore and the file is overwritten without any input from the user.

Please do not forget to put "CmdNoWarningDisp=False" after the line where you save the data. Otherwise Diadem won't show you any other warning message.

Message 2 of 3
(4,678 Views)

I ran into this problem using DIAdem 2020.  My solution was similar to yours, but I needed both CmdNoWarningDisp and CmdNoMsgDisp to eliminate all warnings.  

 

Dim  bCmdNoWarningDisp, bCmdNoMsgDisp

'Record the existing state of CmdNoWarningDisp and CmdNoMsgDisp
bCmdNoWarningDisp = CmdNoWarningDisp: bCmdNoMsgDisp = CmdNoMsgDisp

CmdNoWarningDisp = True: CmdNoMsgDisp = True

Call DataFileSave(sFilePath, uCase(NameSplit(sFilePath,"E")), True)

'Return CmdNoWarningDisp and CmdNoMsgDisp back to prior values.

CmdNoWarningDisp = bCmdNoWarningDisp: CmdNoMsgDisp = bCmdNoMsgDisp

0 Kudos
Message 3 of 3
(2,698 Views)