Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

.BAT style commands in debugger

Stuart_M_
Beginner
653 Views
Hello again O' Most Helpful People

Not sure if I'm just not searching for the right phrase, here or elsewhere online, but I'm trying to find a way to automatically delete some files from the $(ProjectDir) as a pred-debug event. Currently I am forced to navigate my way to the directory and manually delete the files (the model crashes if either are present), but after doing this about a billion times it's getting old.

Something akin to the Pre-Build Event would be perfect, only "pre-debug" obviously.

?

Thanks
0 Kudos
2 Replies
Steven_L_Intel1
Employee
653 Views
There isn't an event that runs on a debug, but I wonder (haven't tried this) if you could replace the "Command" in the Debugging property page with an invocation of a .bat file that does the delete and then runs the EXE? This might not work depending on how the debugger gets control, but it's worth a shot.
0 Kudos
jimdempseyatthecove
Honored Contributor III
653 Views

In the main program insert conditional compilation code that expands in Debug build. This code checks the command line for an option switch, you define the switch (e.g. -deleteFiles). This code could always be present if you want.

Then in the Debug Build, Debug command line options, add your secret switch.

When your program starts it tests for this option, if found, it deletes the files (or changes an open STATUS from OLD/UNKNOWNtoREPLACE).

Jim Dempsey
0 Kudos
Reply