Hi,
Is there a way to show in the DebugOutput window the script line number from where the Debug command was executed ?
If not, It could be added as a checkbox option in the Preferences > Debugger.
Thanks.
DebugOutput window / Script line
DebugOutput window / Script line
Windows 10 Pro x64
PureBasic 6.20 x64
PureBasic 6.20 x64
-
- Addict
- Posts: 1520
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
Re: DebugOutput window / Script line
Code: Select all
Macro Line
Str(#PB_Compiler_Line)+" "
EndMacro
Debug Line+"Text"
Debug Line+"Text"
Debug Line+"Text"
Debug Line+"Text"
Re: DebugOutput window / Script line
Code: Select all
Macro Line
#PB_Compiler_File + " line " + Str(#PB_Compiler_Line) + " "
EndMacro
Re: DebugOutput window / Script line
Another macro variation:
outputs:
Code: Select all
;Use macro DebugL when you want the line number included before the debug output
Macro DebugL
Debug "" + #PB_Compiler_Line + ": " +
EndMacro
DebugL "Before Loop"
For i = 1 To 10
DebugL i
Next
DebugL "Loop complete"
Code: Select all
9: Before Loop
11: 1
11: 2
11: 3
11: 4
11: 5
11: 6
11: 7
11: 8
11: 9
11: 10
14: Loop complete
Re: DebugOutput window / Script line
I know about macro and #PB_Compiler_File constant but I suppose it's pretty easy to add it in DebugOuput through a parameter.
Windows 10 Pro x64
PureBasic 6.20 x64
PureBasic 6.20 x64
Re: DebugOutput window / Script line
@Demivec: When I run your code, my line numbers are offset by -2 compared to yours (below is the output).
I copied your code exactly and the first line in the IDE is the ";Use macro DebugL..." comment.
Did you have 2 empty lines in your IDE before your code?
I copied your code exactly and the first line in the IDE is the ";Use macro DebugL..." comment.
Did you have 2 empty lines in your IDE before your code?
Code: Select all
7: Before Loop
9: 1
9: 2
9: 3
9: 4
9: 5
9: 6
9: 7
9: 8
9: 9
9: 10
12: Loop complete