The 'TStringClass' class is designed to manage large string variables by encapsulating a core PChar type text buffer within a controlled class wrapper. Standard Object Pascal 'STRING' type text variables are easy to use and manipulate, but suffer from a having a maximum size of 255 characters. If you are processing large arrays of STRING type variables they can waste valuable stack or heap space. The alternative to using STRING types is to use the null terminated string (or 'PChar') type. For most programmers PChar's are a necessary evil. This 'TStringClass' object was originally developed to solve some of the problems that are frequently encountered whilst using 'PChar' type variables, namely:
The TStringClass object offers solutions to these and other related problems. It controls its own internal buffer for holding the PChar variable, and before performing any assignments or concatenations it always checks to see that sufficient room is available. If there is insufficient space it re-sizes the buffer to fit the required action. This object was originally created to counteract problems with 'guess-timating' the PChar variable buffer length for complicated SQL expressions. Since then it has been expanded to cover almost anything that can be done with a string type variable, with 190+ methods now available, including:
As a rule the object is designed to handle the problems of passing NIL or zero length PChar parameters. It can also manage the thorny old problem of passing parameters which are un-initialised or remain in use after they have been disposed. These are captured by exception handling.
The product is supplied with a detailed manual in both Word For Windows and HLP format. It includes a test bed application that illustrates the use of of the main methods.
TStringClass is a shareware product. It is fully functional, and includes DCU files for both DELPHI 1 and DELPHI 2. To obtain the source code you must register your use of the product. For further information select the 'Order' option shown below
Download the shareware version (460KB)