Just starting out? Need help? Post your questions and find answers here.
Josh
Addict
Posts: 1183 Joined: Sat Feb 13, 2010 3:45 pm
Post
by Josh » Wed Mar 22, 2017 11:30 am
Why does this code not stop at 'CallDebugger', if the last line is uncommented?
Code: Select all
CompilerIf Defined (xxx, #PB_Constant) = #False
CallDebugger
CompilerEndIf
;Debug #xxx
Testet with:
Pb 5.51
Pb 5.60
sorry for my bad english
TI-994A
Addict
Posts: 2512 Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:
Post
by TI-994A » Wed Mar 22, 2017 12:11 pm
Josh wrote: Why does this code not stop at 'CallDebugger', if the last line is uncommented?
Code: Select all
CompilerIf Defined (xxx, #PB_Constant) = #False
CallDebugger
CompilerEndIf
;Debug #xxx
You'd get a "constant not found" error if the last line is uncommented.
Texas Instruments TI-99/4A Home Computer :
the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel
Josh
Addict
Posts: 1183 Joined: Sat Feb 13, 2010 3:45 pm
Post
by Josh » Wed Mar 22, 2017 12:17 pm
TI-994A wrote: You'd get a "constant not found" error if the last line is uncommented.
Wow, thanks for this knowledge. But this still doesn't explain why CompilerIf isn't working in this case.
sorry for my bad english
TI-994A
Addict
Posts: 2512 Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:
Post
by TI-994A » Wed Mar 22, 2017 12:31 pm
Josh wrote: ...thanks for this knowledge. But this still doesn't explain why CompilerIf isn't working in this case.
Code: Select all
;#xxx not defined
CompilerIf Defined (xxx, #PB_Constant) = #False
CallDebugger ; called
CompilerEndIf
Code: Select all
#xxx = 1 ; defined
CompilerIf Defined (xxx, #PB_Constant) = #False
CallDebugger ; not called
CompilerEndIf
And, you're welcome!
Texas Instruments TI-99/4A Home Computer :
the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel
Josh
Addict
Posts: 1183 Joined: Sat Feb 13, 2010 3:45 pm
Post
by Josh » Wed Mar 22, 2017 12:35 pm
And what have your two examples to do with my code? Nothing!
sorry for my bad english
Fred
Administrator
Posts: 16681 Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:
Post
by Fred » Wed Mar 22, 2017 12:39 pm
CallDebugger is a runtime function, if you uncomment the last line, you get a compilation error.
Josh
Addict
Posts: 1183 Joined: Sat Feb 13, 2010 3:45 pm
Post
by Josh » Wed Mar 22, 2017 1:42 pm
Sounds logical I wanted to check some compiler options at the beginning of my code like this:
Code: Select all
CompilerIf Defined (PB_Editor_CreateExecutable, #PB_Constant) = #False
CallDebugger
CompilerEndIf
So I have to make some changes
Thxs @Fred
sorry for my bad english
Shield
Addict
Posts: 1021 Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:
Post
by Shield » Wed Mar 22, 2017 1:52 pm
Are you looking for CompilerError "my error"?
Josh
Addict
Posts: 1183 Joined: Sat Feb 13, 2010 3:45 pm
Post
by Josh » Wed Mar 22, 2017 1:58 pm
Shield wrote: Are you looking for CompilerError "my error"?
My program speaks German
Thxs
sorry for my bad english