home *** CD-ROM | disk | FTP | other *** search
- Last Minute News on SysTools 2
- ==============================
-
- This file describes changes, additions, and clarifications to SysTools that
- do not appear in the printed documentation. Please print and read this file
- prior to using SysTools, and save it for future reference. It includes the
- following sections, which are organized according to the topic/module to
- which they apply:
-
-
- 1. Additions/Changes
- 2. Known Issues
- 3. Manual Errata
-
-
- 1. Additions/Changes
- ==============================================================================
-
- TStExpression
- -------------
- The TStExpression component was added in version 2.01 and is not documented
- in the printed manual or on-line help. See STEXPR.TXT in the SysTools
- directory for additional information.
-
-
- TStExpressionEdit
- -----------------
- The TStExpressionEdit component was added after the manual and help were
- finalized. It is not documented in the printed manual or on-line help. See
- STEXPR.TXT in the SysTools directory for additional information.
-
-
- StAstroP
- --------
- StAstroP - The PlanetsPos function was changed to a procedure with the
- function result changed to a var (reference) parameter. This change allows
- the routine to be used in C++Builder applications as well as Delphi.
-
- procedure PlanetsPos(JD : Double; var PA : TStPlanetsArray);
-
-
- TStBarCode
- ----------
- A new method was added:
-
- procedure SaveToFile(const FileName : string);
-
- => SaveToFile writes the bar code image to a file.
-
- This routine allows you to save the displayed bar code as a bitmap file
- (.BMP).
-
-
- TStString
- ---------
- StString now has a default index property (AtIndex) that allows access to
- the character at a given index within the string buffer. This allows
- operations such as:
-
- OStr[8] := 'g'; or MyChar := OStr[4];
-
- If an index is accessed that is outside the confines of the string buffer,
- an EStStringError exception will be raised with the message "Index out of
- string bounds". This property is affected by the OneBased property.
-
-
- TStDictionary
- -------------
- The manual doesn't make it very clear that the Hash property and the Equal
- property are linked in terms of their functionality. If you use a hash
- function that calculates a case-insensitive hash of a string then the Equal
- function must perform a case-insensitive comparison of two strings. If the
- hash function calculates a case-sensitive hash, then the Equal function must
- perform a comparison that is case-sensitive as well. If you do not ensure
- this behavior, the effect may be that you will "lose" strings in the string
- dictionary (in other words, you might not be able to find a string you just
- inserted).
-
- Some late testing of the hash function used by default in the SysTools
- string dictionary class has shown that, although it performs well when
- hashing random strings, it performs badly when hashing strings that have
- a great deal of similarity with each other.
-
- Two new hash functions have been added to the STDICT unit: AnsiELFHashText
- (case-insensitive hash) and AnsiELFHashStr (case-sensitive hash), both of
- which use the UNIX ELF hash algorithm. It is highly recommended that you do
- not accept the default hash function that is set up by the Create
- constructor of the class. Immediately after you have created a string
- dictionary instance, replace the hash function with one of the new ones,
- as the following code shows:
-
- MyDict := TStDictionary.Create(MyNodeCount);
- MyDict.Hash := AnsiELFHashText;
-
- Doing this as a matter of course in your code will ensure that the
- efficiency of the string dictionary is maintained for all input strings.
- We decided against modifying the default behavior of the string dictionary
- since there may be users who are dependent on the existing implementation.
-
- function AnsiELFHashText(const S : string; Size : Integer) : Integer;
- Case-insensitive ELF hash function
-
- This function converts the input string S to uppercase using the current
- language driver, and then calculates the ELF hash of the result. An ELF
- hash is a well-known hash function originally devised for the UNIX
- operating system.
-
- function AnsiELFHashStr(const S : string; Size : Integer) : Integer;
- Case-sensitive ELF hash function
-
- This function calculates the ELF hash of the input string S. An ELF
- hash is a well-known hash function originally devised for the UNIX
- operating system.
-
-
- TStTrayIcon
- -----------
-
- The following properties are not in the printed manual but do appear in
- the help file:
-
- Animate
- Images
- ImageIndex
- Interval
-
- When restoring the application via code use TStTrayIcon.RestoreApplication
- rather than Application.Restore.
-
- When starting an application in the normal state and with the HideOnRestore
- property set to true you will need to manually remove the icon from the
- tray when the application starts. For example:
-
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- if (WindowState <> wsMinimized) and (StTrayIcon1.HideOnRestore) then
- StTrayIcon1.DeleteFromTray;
- end;
-
-
- TStVersionInfo
- --------------
-
- TStVersionInfo does not raise an EFOpenError as the manual states. Instead,
- an EStVersionInfoError exception is raised if the file cannot be found.
-
- TStVersionInfo raises an exception if the key specified in the GetKeyValue
- method is not found.
-
- TStVersionInfo may on occasion raise an exception when creating the value
- of the FileVersionFloat and ProductVersionFloat properties. This is normal
- but the exception will show in the IDE if Break on Exceptions is on.
-
-
- TStFormatDrive
- --------------
- The OnFormatError event is not documented in the manual but is in the
- help file.
-
-
- TStFileOperation
- ----------------
-
- TStFileOperation can appear to behave erratically when the foNoErrorUI
- value of the Options property is on. This is due to oddities in the shell's
- implementation of SHFileOperation. For best results leave foNoErrorUI off.
-
-
- Shell Functions Not Documented in the Printed Manual
- ----------------------------------------------------
-
- GetSpecialFolderPath
- --------------------
- Delphi:
- function GetSpecialFolderPath(Handle : HWND;
- Folder : TStSpecialRootFolder) : string;
-
- C++Bulder:
- AnsiString __fastcall GetSpecialFolderPath(HWND Handle,
- TStSpecialRootFolder Folder);
-
- This function returns the path to a shell special folder. Handle is the
- window handle that will act as the owner of any dialogs that the shell
- displays during the operation. Folder is the shell special folder for which
- to obtain the path. The following example will return the path to the
- desktop folder:
-
- Delphi:
- var
- S : String
- ...
- S := GetSpecialFolderPath(Handle, sfDesktop);
-
- C++Builder:
- String S = GetSpecialFolderPath(Handle, sfDesktop);
-
-
- GetSpecialFolderFiles
- ---------------------
- Delphi:
- procedure GetSpecialFolderFiles(Handle : HWND;
- Folder : TStSpecialRootFolder;
- Files : TStrings);
-
- C++Builder:
- void __fastcall GetSpecialFolderFiles(HWND Handle,
- TStSpecialRootFolder Folder,
- TStrings* Files);
-
- GetSpecialFolderFiles will return the list of files in a shell special
- folder. Handle is the window handle that will act as the owner of any
- dialogs that the shell displays during the operation. Folder is the shell
- special folder for which to obtain the list of files. Files is the TStrings
- descendant which will receive the list of files. The following example
- adds the list of files in the recent documents folder into a list box:
-
- Delphi:
- GetSpecialFolderFiles(sfRecentFiles, ListBox.Lines);
-
- C++Builder:
- GetSpecialFolderFiles(sfRecentFiles, ListBox->Lines);
-
-
- 2. Known Issues
- ==============================================================================
-
- Compiler Error Using Shell Components in BCB 1
- ----------------------------------------------
- There is an error in one of the Inprise-generated headers which causes a
- compiler error in any application using the shell components. The problem is
- a blank line in REGSTR.HPP. If you are using BCB 1 you can edit REGSTR.HPP
- and delete the offending line (the compiler will point out the problem line).
- We doubt there is any other work-around for this problem since the headers
- are provided by Inprise.
-
- Using Orpheus and SysTools TStVersionInfo Component in BCB
- ----------------------------------------------------------
- If you use the TStVersionInfo component in a project which also uses
- Orpheus you may get a compiler error in StVInfo.hpp. The problem is that
- TStVersionInfo has a property called ProductName and Orpheus has a constant
- by the same name. The workaround is to move the include for StVInfo.hpp
- above the includes for all Orpheus header files. This will be fixed in the
- next release of Orpheus.
-
-
- 3. Manual Errata
- ==============================================================================
-
- The StUtils unit is documented as containing the DateTimeToStTime,
- DateTimeToStDate, StTimeToDateTime, and StDateToDateTime routines, but they
- are actually in the StDate unit.
-
- References to the TStShortCut.Location property in the manual should say
- LocationType.
-
- References to the TStShortCut.ShortcutName property in the manual should say
- ShortcutFileName.
-
- The page numbers shown in the index are off by 2.
-
-