for example:
Code: Select all
Procedure Test(a)
If a=0
Debug "Don't Call test with 0!"
Debug DebugCallingPosition() ;should output "file at line xyz"
CallDebugger
EndIf
EndProcedure
test(0)
Code: Select all
Procedure Test(a)
If a=0
Debug "Don't Call test with 0!"
Debug DebugCallingPosition() ;should output "file at line xyz"
CallDebugger
EndIf
EndProcedure
test(0)
Hi,GPI wrote:When a procedure detect, that a parameter has a complete wrong value, it would be nice to get the position of the "Calling-Position"
Code: Select all
Procedure Test(a)
If a=0
Debug "Don't Call test with 0!"
ShowCallstack() ;should show "line xyz and contents of last line called before this procedure"
CallDebugger
EndIf
EndProcedure
test(0)
It is necessary?GPI wrote:should output "file at line xyz"
Code: Select all
Procedure Test(a)
If a=0
Debug "Don't Call test with 0!"
Debug #PB_Compiler_Filename+" "+#PB_Compiler_Procedure+" "+#PB_Compiler_Line
CallDebugger
EndIf
EndProcedure
test(0)
If "this" refers to User_Russian's post, then I agree.GPI wrote:this will report the line with the debug.
Code: Select all
Procedure MyFunction(x)
If x > 0 And x < 12
; DoSomething
CompilerIf #PB_Compiler_Debugger
Else
DebuggerWarning(#PB_Compiler_Module+"::"+
#PB_Compiler_Procedure+
"(): OUT OF BOUNDS ERROR! >>> Please [Step out (F11)] of this function using the debugger and check your previous function call!")
ShowCallstack():CallDebugger
CompilerEndIf
EndIf
EndProcedure
MyFunction(14)
Code: Select all
DebuggerWarning("OUT-OF-BOUNDS ERROR at Line: "+Callstack_GetCallerLineNumber())