View previous topic :: View next topic |
Author |
Message |
bstott
Joined: 03 Apr 2008 Posts: 10
|
Posted: Thu Feb 27, 2025 1:44 am Post subject: Statements that execute in debug mode only |
|
|
I use FTN95 Win-32 with SDBG. I'm sure this has been brought up before, but I now need a way to branch the execution path depending on whether the code was compiled in release or debug modes. Some compilers handle this with simple special in-code statements, but I can't find anything about how to achieve this in FTN95. Help will be much appreciated. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8145 Location: Salford, UK
|
Posted: Thu Feb 27, 2025 8:30 am Post subject: |
|
|
This is one way, with /CFPP on the FTN95 command line...
Code: | program main
#ifdef _DEBUG
print*, "Debug mode"
#endif
end program |
|
|
Back to top |
|
 |
bstott
Joined: 03 Apr 2008 Posts: 10
|
Posted: Fri Feb 28, 2025 6:28 pm Post subject: |
|
|
Many thanks. That works well, but it seems to require that the specific F90 file in my multi-file project containing the test must itself be compiled (or not) in debug mode. You mentioned other ways. What would be ideal for me is a test in the code that recognizes when SDBG is actually running. Is there anything like this? |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8145 Location: Salford, UK
|
Posted: Fri Feb 28, 2025 10:17 pm Post subject: |
|
|
bstott
I think that the short answer is "no", there is no such facility in FTN95 or SDBG.
There will be a way to do it via calls to Windows API functions in order to get the parent process but I don't have the details to hand. |
|
Back to top |
|
 |
|