gbCodeRX
gbCodeRX provides useful methods of analyzing code content and of re-ordering code to facilitate
browsing and maintainance of source code. Analysis may be extended to cover all called include files. Merged listings of selected procedures and include files may be created.
Content of code listings and include file content may be viewed in a variety of ways - non-procedural code only, procedural code only, sorted procedure lists, call trees (forward and reverse), API called tree, and more. Procedures may be individually positioned using drag and drop, and may be selected for exclusion/inclusion in merged lists.
Code listings may be edited within syntax highlighted Scintilla editors. Both API and procedures names may be highlighted.
The depth of include file coverage can be constrained to first-level or all nested includes. A user-defined list of include files may be ignored (defaults to the PowerBASIC and Jose Roca include files).
A variety of useful external tools is distributed with, and may be called by, gbCodeRX. These include
PBReference, PBCodec, gbSearch, gbSearchLite, gbMagnify, and gbRuler.
The next image shows the main screen of gbCodeRX. An application code
listing is shown on the left, with the extracted/sorted code procedures
shown on the right.
Key Features List
Key features of gbCodeRX include:
- Build new code listing with procedures sorted by name
- Display list of procedure names (Sub and Functions)
- Display procedure code
- Display non-procedure code
- Sort procedures by ascending or descending procedure name
- Sort procedures by forward/reverse call sequence
- Call Tree (call and called by sequences)
- Open source code files (display in gbCodeRX)
- Open source code files in PowerBASIC IDE
- Toggle display to use entire width for Input or Output
- Font selection
- Syntax highlighted source code display
- Highlight procedure names within code (separate from keywords)
- Upper/Lower/Mixed case code display
- Update EXE via online server
- Line numbers
- Online Help
As a safety feature, gbCodeRX allows "Save-As" actions, but does not provide a "Save" feature.
This is to minimize the chance that a user might overwrite an existing source code file.
Using gbCodeRX
To start using gbCodeRX, you need a source code listing, which goes into the
INPUT Scintilla control. You can Open (toolbar button) an existing source code
file (*.bas or *.inc) or you can paste content into the INPUT side.
With source code available, you can take any of several actions.
Display procedure titles
- Display non-procedure code
- Display procedure code (un-sorted)
- Display procedure code (Ascending sort)
- Display procedure code (Descending sort)
- Display all code (Ascending, Forward Call, or Reverse Call sorts)
- Dipslay call tree (call or called by sequences)
Each of these actions are taken by using the corresponding toolbar button. The
results are displayed in the OUTPUT side of gbCodeRX.
There are two ways to update the original source code to contain the sorted procedure
listings.
- Open the original code in an IDE, delete the procedures, paste in the sorted procedure
listing from gbCodeRX
- In gbCodeRX, display the non-procedure code and copy it all to the clipboard. Then
display the procedure code. Paste the non-procedure code at the top of the procedure code
listing. Use the OUTPUT context menu item "Save-As" to save the listing to a file
The Input/Output editors also provide standard Cut/Copy/Paste context menus.
That's it!
Toolbar
The gbCodeRX interface includes the following toolbar.
The following options are available from the toolbar. Some buttons provide
additional dropdown menu options.
- Open
Select a source code file to display in Input
- Clear
Clear the Input and Output
- Reload
Display current file name in Input
- Titles
Display an unsorted list of procedure names in the Output
- Non-Proc
Display non-procedure code in the Output
- Proc
Display procedure code in the Output. It will be in the same
order as it was found in the Input.
- SortA
Display procedure code in the Output, sorted by ascending procedure name
- SortD
Display procedure code in the Output, sorted by descending procedure name
- Build
Build new code listing that include non-procedural code as well as
code procedures (sorted by procedure name)
- Call
Display call tree showing sequence of procedure calls
- Called By
Display call tree showing all procedures which call each procedure
- Copy Left
Copy the Output content to the Input editor.
Disabled when a call tree is displayed.
- Save As
Save the Output content to file
Disabled when a call tree is displayed.
- IDE
Open the current Input content in the PowerBASIC IDE.
Disabled when a call tree is displayed.
The associated dropdown menu offers the following menu items:
- Select IDE
Select the IDE in which to open the current file
- Font
Select a font to use in the Input/Output displays
- Settings
When pressed, reverses the Ignore PBMain/DlgProc settings.
The associated dropdown menu offers the following menu items:
- Build In Ascending Procedure Order
Places PBMain at top, followed by all procedures
in ascending procedure name order
- Build In Forward Call Order
Places PBMain at top, followed by procedures as they are called
- Build In Reverse Call Order
Places PBMain at bottom, preceded by procedures as they are called
- PBMain As Non-Procedure
Treat PBMain function as non-procedure code
- DlgProc As Non-Procedure
Tree DlgProc callback function as non-procedure code
- Syntax Highlighting
Enables syntax highlighting
- Procedure Name Highlighting
Highlights procedure names wherever they occur in
code, using a different color scheme than keywords
- Upper Case
Display syntax highlighted code in upper case
- Lower Case
Display syntax highlighted code in lower case
- Mixed Case
Display syntax highlighted code in mixed (as entered) case
- Help
Opens the online Help page. The associated dropdown menu offers
the following menu items:
- Online Update
Updates the gbCodeRX EXE to the latest version
Keyboard Shortcuts
The following key combinations are available to the user to access gbThreads features:
- F1 - Help
- F2 - Show list of procedure names
- Ctrl-F - Select font
- Ctrl-L - Copy left
- Ctrl-N - Extract non-procedure code
- Ctrl-O - Select/open source code file
- Ctrl-P - Extract procedure code
- Ctrl-R - Reload source code from file
- Ctrl-S - Extract/Sort procedures
- Ctrl-T - Show list of procedure names
Other Comments
Miscellaneous information is provided in this section.
INI File
gbCodeRX application settings are saved in an INI file,
kept in the same folder as the gbCodeRX application.
Comments and suggestions are welcome!