replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Statements that execute in debug mode only
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Statements that execute in debug mode only

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
bstott



Joined: 03 Apr 2008
Posts: 10

PostPosted: Thu Feb 27, 2025 1:44 am    Post subject: Statements that execute in debug mode only Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8145
Location: Salford, UK

PostPosted: Thu Feb 27, 2025 8:30 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
bstott



Joined: 03 Apr 2008
Posts: 10

PostPosted: Fri Feb 28, 2025 6:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8145
Location: Salford, UK

PostPosted: Fri Feb 28, 2025 10:17 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group