This project is read-only.

Thor TWEeT #26: Three New Thor Tools

Three new tools have been added recently to the Thor Repository.

Split a Procedure File

The tool Split a Procedure File splits out all procedures and functions from a PRG file into separate PRG files. 

It first prompts for the name of the procedure file and then for the folder in which the new PRGs are to be created.

Note that this creates new PRGs for procedures and functions, but does nothing for classes.

Thanks to Tamar Granor for this contribution.


Find Buffer Overrun Threats

As described in TWEeT #23: Buffer Overruns, you may encounter buffer overrun errors when using PEM Editor or IntellisensesX on some forms and classes.  This unusual error, which blows away your session like a C5 error, is caused by long Parameter or LParameter statements.

The tool Find Buffer Overrun Threats searches a project or folder with sub-folders for statements which might cause buffer overrun errors. Note the use of the word “might”; it is difficult to pin down the exact case where these errors occur, as the rules are different in PRGs than in VCXs and are affected by internal comments.

The result from running this tool is a cursor, shown using Super Browse.


To test whether any of the threats identified in the cursor will actually generate a buffer overrun, run the following:

oObject = Newobject(‘yourclass’, ‘yourclasslib’, 0)

?Amembers(laArray, oObject, 3)

Compress Parameters List

Use tool Compress Parameters List to fix any long Parameters lists that are causing buffer overrun errors.

Navigate to the problem code, highlight the entire parameters statement, and run this tool.  It will remove all un-necessary characters from the statement (including spaces, tabs, CRs, LFs, semi-colons, and end-of-line comments.)


See also History of all Thor TWEeTs and the Thor Forum.

Last edited Dec 22, 2014 at 2:40 PM by JimRNelson, version 3


No comments yet.