TWEeT #25: Five New Thor Tools for FoxBin2PRG
Thor TWEeT #25: Five New Thor Tools for FoxBin2PRG
There are five new tools in the Thor Repository for working with FoxBin2PRG.
Four of these tools provide different ways for converting the binary files (“X” files) in a project to their corresponding text files or going the other direction, from the text files to the binary files:
- Convert all binary files to text files
- Convert files with changed internal timestamps
- Convert most recently changed binary files
- Generate binary files from all text files
Each of these tools are project-related, as they use the active project, if there is one, or else prompt for the name of the project to work on.
The other tool creates “SendTo” shortcuts in Explorer so that you can convert to/from text files while working in Explorer.
All of these tools assume that you have downloaded and installed FoxBin2PRG. This works automatically if you have used Thor’s Check For Updates to download it, as they know exactly where to look for it. Otherwise, you can modify the Plug-In“Get FoxBin2PRG Folder” to point to the folder where you have installed FoxBin2PRG.
Thanks to Mike Potjer, who wrote three of these tools, which inspired the creation of the other two which are based on the file and internal timestamps.
Convert all binary files to text files
The tool Convert all binary files to text files converts a VFP .PJX file, and all the binary files in the project, to their FoxBin2Prg text format. This conversion is done through the FoxBin2Prg.EXE, so all your FoxBin2Prg configuration settings will be respected.
For large projects, this may take a while, so there is a progress bar to demonstrate that it is awake.
You can run this tool programmatically as well.
ExecScript(_Screen.cThorDispatcher, ‘Thor_Tool_Repository_FoxBin2PrgConvertProjectToText’)
Convert files with changed internal timestamps
The tool Convert files with changed internal timestamps converts all binary files where the internal timestamps in the rows of the binary file have changed. These timestamps are changed when you use any of the designers (Form, Class, Report, and so on) or when you make replacements using GoFish, so the effect is that the conversion is only performed for the small number of files you have changed since the last time this tool was run.
This effect is achieved by setting the timestamp on the each text file to match the most recent timestamp on any of the rows in the corresponding binary file.
This tool can be dramatically faster than Convert all binary files to text files for those projects where most files are not being changed. (For example, it takes about 40 seconds to runConvert all binary files to text files for my largest project, only 2 or 3 seconds to run this tool when I have only changed a handful of files.)
Note, however, if you hack a file, whether by HackCX or manually, the text file may not be automatically created, as the internal timestamps in the rows of the binary file will not have changed. There are a number of ways you can correct for this
- Use tool Convert most recently changed binary files (below).
- Open the binary file in its Designer, make a slight modification to it, and save it.
- Erase the text file manually.
You can run this tool programmatically as well.
ExecScript(_Screen.cThorDispatcher, ‘Thor_Tool_Repository_OptimizedFoxBin2PrgConvertProjectToText’)
Convert most recently changed binary files
The tool Convert most recently changed binary files converts the most recently changed external timestamp (such as you see in Explorer). You can indicate the definition of “most recently changed” to be based either on the number files to change or the number of days since they have changed:
This tool was originally created as a solution to the problem noted above where text files might not be re-created for binary files that have been hacked, but there is no particular reason that this is its only usage.
You can run this tool programmatically as well.
ExecScript(_Screen.cThorDispatcher, ‘Thor_Tool_Repository_ConvertMostRecentToText’)
Generate binary files from all text files
The tool Generate binary files from all text files works in the other direction, creating binary files from the text files.
This tool currently assumes you are using the PJ2 extension for your project text file, but this easy enough to change via a constant in the tool code. Perhaps in the future the tool can be enhanced to get the extension from an option setting or by reading FoxBin2Prg configuration settings. All other extensions are handled according to the FoxBin2Prg configuration settings.
There are limitations with this tool due to the way VFP leaves VCX files in memory, and thus it will try to executeClear All, which is only possible when called from a menu or via hotkey. The tool will still run from the Tool Launcher or the Thor toolbar, but you will get a warning, and under certain conditions FoxBin2Prg might give you an error message and not regenerate your .VCX files.
You can run this tool programmatically as well.
ExecScript(_Screen.cThorDispatcher, ‘Thor_Tool_Repository_FoxBin2PrgConvertTextToProject’)
Create/Edit FoxBin2Prg "SendTo" shortcuts
The tool Create/Edit FoxBin2Prg "SendTo" shortcuts displays a dialog that makes it easy to setup or remove Windows "Send to" shortcuts for the VB scripts included with FoxBin2Prg. If you already manually created shortcuts in the standard user "Send to" folder, this tool should find them and allow you to edit them.
- A default name for the shortcut is displayed in a textbox, allowing you to edit the name directly in this form. TAB out of the textbox when you finish editing the name, then either
- Click the Create button to add the shortcut, if it doesn't already exist, or
- Click the Save button to update the name if the shortcut already exists.
After clicking the Create button,
- The caption will change to Edit, allowing you to edit any other settings of the shortcut, and
- The shortcut will now appear under the "Send to" context menu in Windows Explorer.
The Edit button opens the Windows file properties dialog, where you can edit any settings of the shortcut.
The Remove button simply deletes the shortcut, moving it to the recycle bin. There is a non-visual class in the Thor_Tool_FoxBin2PrgCreateShortcuts.PRG which performs all the real work of this tool, so if you want to create your own version of the tool with a different interface, or no interface at all, it should be pretty easy to do. There is some code commented out in the .PRG which demonstrates creating all the shortcuts programmatically.
See also History of all Thor TWEeTs andthe Thor Forum.
Previous headlines
#36, 2014-11-25 TWEeT #24: Nine New Thor Tools
#35, 2014-11-17 TWEeT #23: Buffer Overrun Detected!
#34, 2014-06-11 TWEeT #22: Related IntellisenseX Tools
#33, 2014-06-04 TWEeT #21: Advanced Features: Plug-Ins for IntellisenseX
#32, 2014-05-29 TWEeT #20: Quick Start Guide to IntellisenseX
#30, 2014-05-10 TWEeT #18: IntellisenseX for Nested Objects
#29, 2014-04-29 TWEeT #17: Using Local Aliases in IntellisenseX
#28, 2014-03-03 TWEeT #16: Custom Keyword List for Field Names
#27, 2014-02-24 TWEeT #15: IntellisenseX and the Alias Dictionary
#26, 2014-02-17 TWEeT #14: IntellisenseX for Objects
#25, 2014-02-10 TWEeT #13: New (hidden) IntellisenseX Feature
#24, 2014-02-03 TWEeT #12: IntellisenseX by Dot or by Hot Key?
#23, 2014-01-27 TWEeT #11: IntellisenseX: Aliases for VFP Tables
#22, 2014-01-20 TWEeT #10: IntellisenseX: Field Names from SQL Server Tables
#21, 2014-01-13 TWEeT #9: Extract to Variable and Extract to Constant
#20, 2014-01-05 TWEeT #8: Creating Properties and Methods (#3)
#19, 2013-12-18 TWEeT #7: Creating Properties and Methods (#2)
#18, 2013-08-26 Thor Version 1.40 released: Thor ToolBar
#17, 2013-06-23 New VFPX Project: Finder
#16, 2013-03-31 New Video: 50 Ways to Run a Thor Tool
#15, 2012-03-05 New Thor Tool: AutoComplete
#14, 2012-01-16 Thor videos available from Thor menu
#13, 2012-01-05 Thor's Tool Launcher: The one tool youmust use
#12, 2012-11-16 Thor menus provide access to Discussion Forums and Change Logs
#11, 2012-11-10 Online FoxPro Users Group (OFUG) created
#10, 2012-10-14 New VFPX Project: FoxcodePlus
#9, 2012-10-06 Easy access to all VFPX home pages
#8, 2012-09-30 IntellisenseX released as a VFPX project
#7, 2012-09-19 All VFPX projects can be downloaded from Thor
#6, 2012-09-16 Use the Thor discussion group
#5, 2012-09-10 IntellisenseX released
#4, 2012-09-09 Data Explorer is now a Thor tool
#3, 2012-09-04 New VFPX Projects: Dynamic Forms & Data Explorer
#2, 2012-08-30 Join the Thor Beta discussion group
#1, 2012-08-25: Introducing Thor News
Thor Version 1.40 released: Thor ToolBar
Added the Thor ToolBar. Tools may be added to the Toolbar may using the checkbox shown in the Thor Configuration form, below (and also available in theTool Launcher.)
When you add a tool to the Thor Toolbar, you can select a caption for the tool or select an image to represent it. In the sample below, abbreviated captions are used.
The toolbar’s size, positioning, and docking, persist from one session to the next. (Truth be told, persisting the docking has been problematic.)
New VFPX Project: Finder
The new VFPX project Finder is a powerful search tool to find forms and classes. It searches either a project or folder (with sub-folders) for names of files or classes.
Files or classes can be opened by double-clicking and there are numerous other options available from the context menu for rows in the grid.
When Class Search is used, the classes found can be dragged/dropped onto forms or classes being edited.
See the Finder Home Page and watch theFinder introductory video (11:25).
Thor videos available from Thor menu
There are already a number of videos explaining features of Thor and there are more to come. Follow the link from the Thor menu to the list of all Thor videos.
Thor's Tool Launcher: The one tool you must use
Thor’s Tool Launcher uses a simple screen that allows you to browse through all the Thor tools by keyword, to read their descriptions or visit their home pages, to set their options, and, most importantly, to run them. It also helps you to organize the tools that you use most to make them easily accessible.
Thor suffers from an over-abundance of tools – there are so many that it may seem impossible to find which tools are of interest to you. The Tool Launcher simplifies that search.
Watch this short video (7:57) to learn all about it.
Thor menus provide access to Discussion Forums and Change Logs
The Thor menu has been changed to provide access to a number of related Discussion Forums.
These forums are the preferred form of communication about these tools, rather than private emails, or using the Universal Thread, Foxite, or any other on-line forums.
Change logs for the various tools and components of Thor are now available, as well as a link to the never ending list of Thor ERs.
Online FoxPro Users Group (OFUG) created
A new Online Foxpro User Group is starting up. For more information, join the Google group athttps://groups.google.com/forum/?fromgroups#!forum/ofug.
Meetings will be held the 3rd Tuesday of each month at 8:30 Eastern Standard Time via GotoMeeting.com or equivalent.
Details about how to join the meeting will be published on the group forum (see link above) immediately before the meeting is to start.
We intend to record the meeting and make it available on-line for those unable to attend.
Next Meeting: Tuesday, November 20th, 8:30 PM Eastern Time (0130 UTC Wednesday, November 21)
Presenters:
- Matt Slay - Dynamic Forms
- Jim Nelson - PEM Editor and related tools
New VFPX Project: FoxcodePlus
The new VFPX project FoxcodePlus (Beta 1) is available from Check For Updates.
This project is not related to IntellisenseX, another VFPX project, although both provide Intellisense enhancements. FoxCodePlus provides a wider range of features and includes some of the features provided by IntellisenseX. Although not yet tested, it appears that the two may be used concurrently.
After downloading (which includes both the code and documentation), you can use the Thor menu pad in the system menu to open the folder in which these components are installed:
Easy access to all VFPX home pages
Thor now provides ready access to the home pages for all VFPX projects, available from the Thor menu pad.
IntellisenseX released as a VFPX project
IntellisenseX has been released as a VFPX project.
IntellisenseX refers to a suite of Thor Tools that provide functionality similar to native Intellisense. These tools display lists of available variable names, field names, or members (properties, events, methods, and objects) while you type code, just like Intellisense. However, they cover those areas that Intellisense forgot (such as the list of field names in a table when editing in a code window) and provide new capabilities, available through customization, such as displaying the list of field names in an SQL table.
Visit the IntellisenseX home page and also watch the Intellisense training videos.
IntellisenseX is available from Check For Updates.
All VFPX projects can be downloaded from Thor
The current version of all VFPX projects can now be downloaded directly from Check For Updates.
The projects listed in Check For Updates are listed alphabetically within these five groups:
- Projects that you have already downloaded for which there is a more current version. (see #4)
- Projects that you have not downloaded which have had updates in the last three months
- All other projects that you have not downloaded
- Projects that you have already downloaded and which are current
- All projects marked as “never update”. This takes precedence over any of the categories above.
Use the Thor discussion group for comments,
suggestions, bug reports, etc.
Use the “Community / Discussions” menu item in the Thor menu pad to send comments, suggestions, bug reports, and so on to the Thor Discussion Group. You are invited to become a member of the group so that you can see what is going on in the land of Thor.
Two things of note:
- You can email discussion questions (with screenshots) directly to:
- When reporting bugs, please provide as much information as possible, including screenshots. Any information you can provide (such as an image of the debugger, etc.) will be greatly appreciated.
IntellisenseX released
IntellisenseX refers to a suite of Thor Tools that provide functionality similar to native Intellisense. These tools display lists of available variable names, field names, or members (properties, events, methods, and objects) while you type code, just like Intellisense. However, they cover those areas that Intellisense forgot (such as the list of field names in a table when editing in a code window) and provide new capabilities, available through customization, such as displaying the list of field names in an SQL table, as shown below. For a full description, see the IntellisenseX Home Page.
Data Explorer is now a Thor tool
Data Explorer 3 is now available as a Thor Tool. This means that you can choose to access it by hot key by assigning the hot key in the Thor configuration form.
New VFPX Projects: Dynamic Forms & Data Explorer
Two new VFPX projects have been created in the last few days and are available from Check For Updates:
After downloading, you can use the Thor menu pad in the system menu to open the folder in which these components are installed:
Join the Thor Beta discussion group.
The Thor Beta discussion group is intended for discussions of features currently under development for Beta versions of Thor, the Thor Repository, and PEM Editor.
All other Thor issues should be directed to the Thor discussion group.
To use the Beta version for Thor, download Thor Repository Beta Updater.Zip and unzip it into this sub-folder of the folder where you have installed Thor:Thor\Tools\Updates\My Updates
Thereafter, you will see a record for "Thor Repository Beta" when you run "Check For Updates".
Introducing Thor News.
This is the first installment of the Thor News, which will notify you of changes and updates to Thor. It will also, from time to time, explore some of the more interesting tools found in Thor.
The latest news will be brought to you:
- each time that you run Check For Updates
- once a week when you execute RunThor.
You can change these settings in the Thor Configuration form: