PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Barry Gordon on October 06, 2015, 07:44:05 PM

Title: ShowERRS - FreeBAsic Error and Warning Dispay Tool
Post by: Barry Gordon on October 06, 2015, 07:44:05 PM
Dear All,

I would like to offer you a little utility (called ShowERRS) that I wrote several months ago (in FreeBasic of course) and that I use regularly and find very helpful.   

It basically goes through the FreeBasic generated '?compilelog.txt' file and the various FireFly code files and collates and displays a more meaningful list of error and warnings messages.

So if you take the following code snippet as an example:-

'=========
Function FORM1_WM_CREATE ( hWndForm as HWnd, ByVal UserData as Integer ) as Integer
'                         
' The variables Test and Test 1 are not defined so should give an error
'
Test = 1
Test1 = 1
'
' The function return is not defined so should give a warning
'
End Function
'=========

Then ShowERRS will generate a window containing the following information and also create a similar text file called ShowERRS.TXT in the RELEASE directory  (see FB1.JPG attached):-

=============================
Processing:  D:\Programming\FreeBasic\BarryFreebasicProjects\Project1\release\_Project1_compilelog.txt

D:\Programming\FreeBasic\BarryFreebasicProjects\Project1\release\CODEGEN_PROJECT1_FORM1_FORM.inc
Line: 624 - 'error 41: Variable not declared, Test in 'Test = 1''
623: '
624: Test = 1
625: Test1 = 1
626: '

D:\Programming\FreeBasic\BarryFreebasicProjects\Project1\release\CODEGEN_PROJECT1_FORM1_FORM.inc
Line: 625 - 'error 41: Variable not declared, Test1 in 'Test1 = 1''
624: Test = 1
625: Test1 = 1
626: '
627: ' The function return is not defined so should give a warning

D:\Programming\FreeBasic\BarryFreebasicProjects\Project1\release\CODEGEN_PROJECT1_FORM1_FORM.inc
Line: 629 - 'warning 13(0): Function result was not explicitly set'
628: '
629: End Function
630:

Completed ...

=============================

If you wish to use this tool then the program .EXE file is attached below in Zip compressed format.    You should decompress the file and place the .EXE in a suitable place.  I have a FreeBasic Tools directory in 'C:\Program Files (x86)\FreeBASIC Tools' and I store it there - but it can be stored anywhere as long as you tell the FireFly 'Tools' 'Edit User Tools' menu.   See attached FB2.JPG for a screenshot of how to set it up.  In the this screenshot - the line

'<R>_<P>_compilelog.txt 1 2 120'

is interpreted to mean:  display 1 line of code before the error line, 2 lines of code after the error line and truncate the ShowERRS.TXT file lines at 120 characters wide.  If the latter is set to 0 then the file will not be truncated.  You can set these parameters to whatever you want.   It is also set so that CTRL-L initiates the display.

I currently use the 32 bit version of FreeBasic - so ShowERRS may need a bit of tweaking to support the 64 bit - but I am happy to sort that out.

I hope somebody finds it useful - any positive feedback is always welcome. 

Regards
Barry
Title: Re: ShowERRS - FreeBAsic Error and Warning Dispay Tool
Post by: Paul Squires on October 06, 2015, 11:53:58 PM
Thanks Barry! Ever since you shared this tool with me a few weeks ago I use it almost daily. It is very useful and I encourage all new FireFly FreeBASIC users to try it out.