07-19-2024, 05:43 AM
Quote:Sometimes I need to switch back and forth between two versions of class files.
Sometimes for it I use #if.
Project main file:
/*/ define TEST_NEW_CODE; /*/
//To switch back and forth quickly, change TEST_NEW_CODE eg to _TEST_NEW_CODE and back; /*/
OldClassFile:
#if !TEST_NEW_CODE
code
#endif
NewClassFile:
#if TEST_NEW_CODE
code
#endif
Or both code versions can be in the same file:
#if TEST_NEW_CODE
new code
#else
old code
#endif