How about including a Tron/Troff command or something that will produce a line trace file. If know there is a ErrorReport.txt file created in the Temp folder under DarkBasic's install, but I don't work from the same Drive that DarkBasic is install in, plus this file is not produced if your code dosen't have any syntax errors.
If a set of commands could be included to list the current Line - Commands being executed, that would be really helpful. Something like this:
SetTraceFile("TraceFile.txt")
TraceOn
....
TraceComment("Seem To Be Having Problems Here")
....
TraceOff
I have to alter a lot of code to be able to perform something like this:
Dim TraceFileOpen(0)
#Constant TraceFile "TraceFile.txt"
`Example Code With Trace Stuff To help See Run
Trace("6:a = 1"):a = 1
Trace("8:If a=1"):If a=1
Trace("9:Print A=1"):Print "A=1"
Else
Trace("11:Print A<>1"):Print "A<>1"
EndIf
Trace("End of Run")
TraceSave()
End
Function Trace(TextString$)
If TraceFileOpen(0) = 0
If File Exist(TraceFile)
Delete File TraceFile
EndIf
Open To Write 1, TraceFile
TraceFileOpen(0) =1
EndIf
Write String 1, TextString$
`ink rgb(255,255,255),0 : print TextString$ : sync : wait key
EndFunction
Function TraceSave()
If TraceFileOpen(0) = 1
Close File 1
EndIf
EndFunction
TraceFile.txt would contain:
6:a = 1
8:If a=1
9

rint A=1
End of Run
Granted, this is overkill for a small program, but if you are working with thousands of lines of code, any clues are helpful in debugging nasty bugs...