Syntax
Module.s = dbResolveErrorLine(ErrorLine, @LineNumberOut)
Description
This command will return a PureGDK-specific error if one exists. The ErrorLine parameter expects the current line number where the PureBasic is reporting the error. The address of LineNumberOut will return the actual line number in your source. The return value Module.s is the filename in which the error occurred.
Example:Procedure ErrorHandler()
Module.s=GetErrorModuleName()
Module.s=dbResolveErrorLine(GetErrorLineNR(),@LineNumber)
Description.s=GetErrorDescription()
String.s=dbGetErrorDescription(@Description.s)+#CRLF$
String.s+"Line: "+Str(LineNumber)+#CRLF$
String.s+"Address: "+Str(GetErrorAddress())+#CRLF$
String.s+"File: "+Module.s+#CRLF$
MessageRequester("Custom Error",String.s)
End
EndProcedure
OnErrorCall(@ErrorHandler());/ Show the PureGDK render window
OpenWindow(0,0,0,640,480,"DarkBasic Professional - PureGDK",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
hDBWnd=OpenDBWnd(WindowID(0),0,0,640,480); dbMakeObjectCube(1,3) ;/ Comment this line to create an error
Repeat: Delay(1)
x.f+0.2: y.f+0.4: z.f+0.8
dbRotateObject(1,x.f,y.f,z.f) ;/ Error here
dbSync()
Until WindowEvent()=#PB_Event_CloseWindow
End
See Also