I'm using #Define & #Ifdef, Ifndef to select 1 of 2 subroutines to select 2 different serial addressing modes.
The Sub's need to be the same name as they are commands in a library (include file).
It looks like 'Overloaded Subroutines' is preceding the #Ifdef, Ifndef.
I made some quick test code attached...
First 2 subs (Sub Test1) with issue, works perfect with Subs 3 & 4 Sub Test2 & Sub Test3
#chip12F683,8#configOsc=IntDimX2asString*10#DefineTestMode1Main:Test1Test2Test3GotoMain'Same name subs issue with Overloading#IfdefTestMode1SubTest1X2="First"EndSub#Endif#IfndefTestMode1SubTest1X2="Secnd"EndSub#Endif'*********************************'Different name subs ok#IfdefTestMode1SubTest2X2="TestMode1"EndSub#Endif#IfndefTestMode1SubTest3X2="TestMode2"EndSub#Endif
Attached test code showing compile time.
However, it is odd indeed! in reverting (undo, undo...) the code that took 9.7s now is 1.4s. Did a file compare to be sure.
The other program I am working on also compiles fast again now (no code changes).
I am using the hex button in Synwrite IDE. If I notice this again I will restart the IDE & see.
I'm using #Define & #Ifdef, Ifndef to select 1 of 2 subroutines to select 2 different serial addressing modes.
The Sub's need to be the same name as they are commands in a library (include file).
It looks like 'Overloaded Subroutines' is preceding the #Ifdef, Ifndef.
I made some quick test code attached...
First 2 subs (Sub Test1) with issue, works perfect with Subs 3 & 4 Sub Test2 & Sub Test3
Probably just the cold mornings & not enough antifreeze...
Putting the #Ifdef, #Ifndef code sections inside the 1 sub works ok
Is it normal to take much longer to compile with 1 each #IFdef & #Ifndef is a program ?
1.79s without & 7.91s with.
Just curious.
Post the program and I can have a look.
It all depends on what the code within you program is calling. But, it does sound a little odd from your timings.
Attached test code showing compile time.
However, it is odd indeed! in reverting (undo, undo...) the code that took 9.7s now is 1.4s. Did a file compare to be sure.
The other program I am working on also compiles fast again now (no code changes).
I am using the hex button in Synwrite IDE. If I notice this again I will restart the IDE & see.
How strange.
The 9.7s code to takes 0.87s here. I removed&enabled to constant but the time is still sub 0.9s.
A mystery. Am I testing incorrectly?
Is probably a win7 anomaly.
I was running previously SimulIDE & it crashes a bit.
Thanks for checking
I also remember crashing the compiler when I forgot to add the # to the Endif,
This may have upset something temporarily.
Last edit: ToniG 2022-06-14
Case closed ? Put it down to an OS anomaly.