Thursday, December 18, 2008

Depending on the source operating system to execute mode

Such as from Visual Studio can be known in many IDE's mode of execution of the source code and determines to be changed. 
Examples include fashion debug or release fashion. 
If the source code on the execution mode is queried, it may, for example, in the source code debug expanded fashion with a program to be compiled, which, for example, different types of logging implemented to improve problem analysis to be carried out. 
This can also make Microsoft Dynamics AX. 

The first must create a new macro level (in this example with the name Running Mode), which acts as a global switch between the execution Feeding types used: 
/* Macro for setting the running Mode. */
/* Activate for debug mode*/
#define .Debug(' true ') 
/* Activate for production mode. */
//#define.Debug('') 
Now, anywhere in the # debug code used to refer to the execution mode to consider: 
static void TestTheRunningMode(Args _args) 
#RunningMode # Running Fashion 
print "of the code should always be executed"; 
if (#Debug) 
print "code only in debug mode is running"; 
}  
pause; 
break; 
}  
Depending on how the Macro Running # debug mode has been defined, can now be activated any source (executed) or disabled (not) be. 

No comments:

How to identify the user that was used to change an object from AOT in AX2012

Get the object name for which we need to track these (user and date&time) information's. Login to SQL Server Management Studio an...