Include Digger

User contributed sources that have become inactive, deprecated, or generally unusable. But ... we don't really want to throw them away either.
bcohio2001
Posts: 556
Joined: Mar 10, 2007 15:44
Location: Ohio, USA
Contact:

Include Digger

Post by bcohio2001 »

Continuing the topic Freebasic Help

http://www.mediafire.com/download/dmyqa ... _0_1_0.zip
Version 0.1.0 Dec. 16, 2014
-- First release.

*************************** IMPORTANT ***********************
* This can only be compiled with FB 0.91 or greater. *
******************************************************************

This program parses all '.bi' files in the 'inc' folder of your freebasic.
Finds subs, functions, macros, defines, UDT's

There is still a lot of work to be done to it.

(Edit: Renamed subject to more accurately reflect programs objective - June 1, 2017)

Source for current version is at https://github.com/bcohio2001/Freebasic-Include-Digger
Last edited by bcohio2001 on Jul 09, 2019 14:46, edited 3 times in total.
bcohio2001
Posts: 556
Joined: Mar 10, 2007 15:44
Location: Ohio, USA
Contact:

Re: FreeBasic Help II

Post by bcohio2001 »

Been a year and a half. Finally got back to it.

Version 0.1.1 July 16, 2016
-- Fixed after clicking item in lower listbox, either show "All Platforms" or list only those that can use.
-- Removed case sensitive search checkbox.
-- Sped up search.

Compiled program and source:
http://www.mediafire.com/download/bjl88 ... _0_1_1.zip

http://www.mediafire.com/view/9wwg7qz0f ... enshot.png
Last edited by bcohio2001 on Jun 01, 2017 23:20, edited 2 times in total.
sancho2
Posts: 547
Joined: May 17, 2015 6:41

Re: FreeBasic Help II

Post by sancho2 »

I backtracked through the posts relating to this to understand what you were doing.
I understand now that this is a tool to quickly view what is contained in the include files. Its a good idea.
I downloaded and ran it. Here are some thoughts.
At first I thought the program didn't work. I located fbc in the file dialog and then everything seemed to disappear and it looked like the program ended.
I ran it again. It was then that I noticed the window asking you to select your configuration. That small window appeared up and off to the side of the screen and I didn't notice it at first.
I recommend keeping everything front and center so the user doesn't miss that window.
Once I found it I could begin. I selected my config. and the main window appeared. On my system I can't see the whole window. The window is not sizeable and the maximize button is disabled. Everything from the bottom half of the second row of listboxes down is not visible or accessable. I recommend not putting everything on the same page.
Since I don't have access to the whole window I can only comment on what I see.
The file dump list box (top riight) is not useful without formatting.
I would like to see the value of constants not just their name.
I would like to see the definition of the subs and functions. I'm thinking maybe when you click on an item the dump window or
another window might show this info.
You should be able to copy the items from the listboxes to the clipboard.
I like this tool idea and encourage you to keep working on it.
Last edited by sancho2 on Jul 21, 2016 2:10, edited 1 time in total.
bcohio2001
Posts: 556
Joined: Mar 10, 2007 15:44
Location: Ohio, USA
Contact:

Re: FreeBasic Help II

Post by bcohio2001 »

sancho2 wrote:I recommend keeping everything front and center so the user doesn't miss that window.
The window is not sizeable and the maximize button is disabled. Everything from the bottom half of the second row of listboxes down is not visible or accessable. I recommend not putting everything on the same page.
The file dump list box (top riight) is not useful without formatting.
I would like to see the value of constants not just their name.
I would like to see the definition of the subs and functions. I'm thinking maybe when you click on an item the dump window or
another window might show this info.
You should be able to copy the items from the listboxes to the clipboard.
I like this tool idea and encourage you to keep working on it.
I see that in your image the file dump window is formatted. I select "dispHelper and the same .bi that is showing in the image.
Thank you for the input.

From what you described, I think that you are running Linux with a lower resolution then me.
The top right text box where the file is displayed is probably expecting a Chr(13) in the file.
All the files that I checked on my system have that, of course did not check ALL files.

Once you click on an item in one of the lower list boxes, the item would be scrolled to in the text area. (off by a line sometimes)
Where there you can copy and paste the item you are looking for.

I will adjust it so the config window is center screen.
I was more worried about getting everything going, so resizing/maximizing was low on my list of things to do.
sancho2
Posts: 547
Joined: May 17, 2015 6:41

Re: FreeBasic Help II

Post by sancho2 »

Hello. Not Linux. I was conscripted to Windows 10.
Its strange that your include files show with the carraige return and mine don't. I checked a lot of the includes and not one was formatting properly.
For example the include allegro\algif.bi. This file loads up nicely formatted in Notepad and Notepad++ and in FBEdit. But it is not formatted in that text box.
As for the config. Maybe instead of forcing that window on a first run, you could show the main window and when the user attempts to select an include, you can force it on them then (if they haven't already done it through the menu option).
Thanks.
bcohio2001
Posts: 556
Joined: Mar 10, 2007 15:44
Location: Ohio, USA
Contact:

Re: FreeBasic Help II

Post by bcohio2001 »

That is weird that yours is not showing correctly. So it is not a problem with Chr(13).

Small snippet of how it is loaded:

Code: Select all

'fill file display
x = FreeFile
Open FBPath + CurrFileDisp For Binary Access Read As #x
GStr = String(Lof(x), 0)
If Get( #x, ,GStr ) <> 0 Then GStr = "Could not access file."
Close #x
SetWindowText(GetDlgItem(hWin, IDC_EDTFDisp), GStr)
I will look into waiting for user event before showing the config dialog.
Currently working on WM_SIZE, gonna be a bear, 17 controls to resize!
sancho2
Posts: 547
Joined: May 17, 2015 6:41

Re: FreeBasic Help II

Post by sancho2 »

For whatever reason this textbox is not parsing LF as it does on your system. I added the following function which replaces all chr(10) with CRLF and it displays formatted. Feed this function 'gstr'.
It would be nice to know if it is just me.
EDIT: Fixed the function so it doesn't overwrite the next char. However this is not thoroughly tested and I think this can be done more efficiently.

Code: Select all

Sub FixLineFeed(ByRef g As String)
	'
	Dim As Integer n = Len(g), x = 1, p = 1, c
	Dim As String s = "" 
	
	
	Do While p < n 
		x = InStr(p, g, Chr(10))
		If x = 0 Then 
			s += Mid(g, p)
			Exit Do
		Else
			s += Mid(g, p, x - p) 
			s += Chr(13) + Chr(10)
		End If
		'Print p
		p = x + 1
	Loop
	
	g = s
	'g[n -1] = 0
End Sub
Have you considered using a tab control instead of a single page to show all the info? Or even if you throw it all on a horiz. and vert. scrollable panel. I'm not sure how easy either of these two options are.
I hate the thought of you re-coding based on 1 user.
By the way, it all compiles and runs nicely in FBEdit.
sancho2
Posts: 547
Joined: May 17, 2015 6:41

Re: FreeBasic Help II

Post by sancho2 »

I know I'm throwing a lot at you right now. I hope i am helping and not annoying.
When I click on the last item in any listbox it crashes out. This might have something to do with my CRLF fix function throwing the item indexing out.
I also noticed that clicking on a const/define scrolls the textbox to where it is, but one line off. The top item in the text box is the line after the item I selected in the listbox. If this is not happening for you then for sure its my function that is throwing the offset indexing off.
Thanks alot for this program.
bcohio2001
Posts: 556
Joined: Mar 10, 2007 15:44
Location: Ohio, USA
Contact:

Re: FreeBasic Help II

Post by bcohio2001 »

sancho2 wrote: I hope i am helping and not annoying.
Yes you are helping point out anything I may have missed. Nice to know that someone is using/trying something that I did.
sancho2 wrote:When I click on the last item in any listbox it crashes out. This might have something to do with my CRLF fix function throwing the item indexing out.
I also noticed that clicking on a const/define scrolls the textbox to where it is, but one line off.
I have had this one line off problem for a while now. Work on it a little, get frustrated, jump to something else.
And crashing when the last item is selected I will look into.
sancho2 wrote:Have you considered using a tab control instead of a single page to show all the info? Or even if you throw it all on a horiz. and vert. scrollable panel.
Not quite sure what you mean.
Set it up like this so if someone was looking for just a function or where and what something is defined as. It would show in the respective listbox.
replaces all chr(10) with CRLF
Already implemented.
Do not have FBEdit running ATM, so it is sort of like this.

Code: Select all

For x = 0 to len(GStr)-1
if GStr[x] = 10 then A += chr(13)
A += chr(GStr[x])
next
Then set the textbox value to 'A' instead of 'GStr'
bcohio2001
Posts: 556
Joined: Mar 10, 2007 15:44
Location: Ohio, USA
Contact:

Re: FreeBasic Help II

Post by bcohio2001 »

Version 0.2.0 July 21, 2016
-- Configuation dialog appears center of screen.
-- Main dialog resizable.
-- File display area will add Chr(13) when needed.

http://www.mediafire.com/download/cfdl2 ... _0_2_0.zip
Last edited by bcohio2001 on Sep 04, 2016 16:50, edited 1 time in total.
sancho2
Posts: 547
Joined: May 17, 2015 6:41

Re: FreeBasic Help II

Post by sancho2 »

Just tried it out.
The window is now completely visible, and sizeable, and maximizable.
The file dump text box is now formatted nicely.
Some problems:
1. None of the list boxes are working now. Select a file and no items get listed in any of the lisboxes.
2. I had lots of windows open when I ran the file. The first thing it does is build a dbase. You provide a window with a progress bar, but in my case that window was hidden behind other open windows. So I had no idea what was happening.
3. The complier options are no longer accessable. They did not appear on the first run and the menu option is no longer working.
bcohio2001
Posts: 556
Joined: Mar 10, 2007 15:44
Location: Ohio, USA
Contact:

Re: FreeBasic Help II

Post by bcohio2001 »

1. No listbox working.
Is this for all files? In the menu select "Follow" and see if any results.
Information in listboxes are listed for the current configuration.

Code: Select all

#ifdef __FB_WIN32__
Declare sub WinOnly()
#else
Declare Sub LinuxOnly()
#endif
So depending on which is selected. Will either show WinOnly() or LinuxOnly() in the Sub Function listbox.
I know that I have preprocessing errors.

2. If you just extracted the new exe file to the same folder, no rebuild of database will happen. Program checks to see if need to create/update the database.

3. Did not appear because not needed. Stored in an ini file. Fixed the problem with the Config dlg not opening via the menu.
bcohio2001
Posts: 556
Joined: Mar 10, 2007 15:44
Location: Ohio, USA
Contact:

Re: FreeBasic Help II

Post by bcohio2001 »

Version 0.3.0 Sept. 4, 2016
-- Filling of listboxes after search is forced to name the first file.
-- Fixed Configuration dialog via menu not activating.
-- NEW DATABASE (Almost complete rewrite!)
---- Intrinsic "__FB_BIGENDIAN__" was not found in parsing of v1.05.0 (01-31-2016) Win64 build.
-- Included ".fbp" file for "FBEdit"

Will create 3 files.
.dat file approximatly 9 MB
.inx file approximatly 7 MB
.ini file approximatly 65 KB

Compiled program (64 bit) and source code:
http://www.mediafire.com/download/1ut0g ... _0_3_0.zip
Last edited by bcohio2001 on Jan 15, 2017 19:09, edited 1 time in total.
bcohio2001
Posts: 556
Joined: Mar 10, 2007 15:44
Location: Ohio, USA
Contact:

Re: FreeBasic Help II

Post by bcohio2001 »

Version 0.3.1 Jan. 15, 2017
-- "Type" parsing fix.
-- Added define for ANSI only.
-- Better limitations on what is displayed in listboxes, dependant on settings.

Source code:
DO NOT USE COMPILED PROGRAM IN THE ZIP FILE! IT IS VERSION 3.0!
http://www.mediafire.com/file/zbshcvpdv ... _0_3_1.zip

Note: If using 3.0 re-verify your "default" settings before rebuilding database.
Last edited by bcohio2001 on Jan 21, 2017 16:08, edited 2 times in total.
datwill310
Posts: 355
Joined: May 29, 2015 20:37

Re: FreeBasic Help II

Post by datwill310 »

Hi,

This program sounds cool! I'll check it out tomorrow when I can use my computer!
Post Reply