ClearBasic cbbatch tip: Display the line number of the most recent error
September 27, 2011
After over a decade of doing ClearBasic coding, I’m still learning new things. Today, Marek pointed out the Erl function, which returns the line number of the most recent error. Within the Clarify Client, if you use the –debugCB option, you’ll get the line number of the last CB error, so it’s pretty easy there. But in cbbatch, it doesn’t tell you the line number. Error message, no line number For example, I have a simple cbbatch script that I’ve coded with an error. Notice how it tells me the error, but it doesn’t tell me *where* the error is. Let caveman debugging commence. Ugh. More error details Now, lets add a simple error handler. At the beginning of my routine, I add an On Error statement: On Error Goto ErrorHandler And then at the end of…