 --------------------------------------------------------
 TUserData Class for Delphi
 A Delphi class to auto-install PalmPilot .PDB and
 .PRC files.

 Copyright  1997 by Art Dahm
 All rights reserved

 Web:     http://members.aol.com/PilotApps
 E-mail:  adahm@earthlink.net
 --------------------------------------------------------
 Based loosely on the C++ TUserData class
 created by Mark Pierce (MakeDocW)
 --------------------------------------------------------

 CONTENTS

 1. General
 2. Using this class
 3. Support, feedback and bugs
 4. Revision History


 1. General
 ----------

 This class has been tested under Delphi 2 and Delphi 3 with
 the PalmPilot Desktop version 2.0 and higher.  TUserData has
 the following PUBLIC functions:

    constructor	Create;
    destructor	Destroy; override;
    function	GetNumUsers: Integer;
    function	GetLastUserNumber: Integer;
    function	GetCore: String;
    function	GetUserMagic(User: Integer): Integer;
    function	GetUserName(User: Integer): String;
    function	GetUserSubDir(User: Integer): String;
    function	InstallUser(User: Integer; FileName: String): Boolean;

  * The functions GetCore, GetUserMagic, GetUserName and GetUserSubDir
     are internal routines and are not normally called by the application.

 2. Using this unit
 ------------------

 To use this class in your applications:

 A. Add the 'AutoInst' unit to your project
 -------------------------------------------

 Copy the file 'autoinst.pas' into your project's directory.

 Add 'autoinst' to your project's USES clause.


 B. Create an instance of TUserData
 -------------------------------------------

 Create a variable of type TUserData:

    var
      UserData: TUserData;


 Create an instance if the variable:

    UserData := TUserData.Create;


 Don't forget to clean up when you're done:

    UserData.Free;


 C. Fill a TComboBox with the list of users
 -------------------------------------------

 This section of code fills a TComboBox with the list of users
 available on the PalmPilot desktop.  The selected item in the
 TComboBox is initialized to the most recent user to use the
 PalmPilot Desktop.  If there are no users (the PalmPilot Desktop
 is not installed), the TComboBox is disabled.

    if UserData.GetNumUsers <> 0 then
    begin
      AutoInstallComboBox.Enabled := True;
      AutoInstallComboBox.Clear;
      for n := 0 to UserData.GetNumUsers-1 do
        AutoInstallComboBox.Items.Add(UserData.GetUserName(n));
      AutoInstallComboBox.ItemIndex := UserData.GetLastUserNumber;
    end
    else
      AutoInstallComboBox.Enabled := False;

 D. Install the .PRC or .PDB file
 -------------------------------------------

 After creating a .PRC or .PDB file, the following line
 of code will auto-install the file.  The file will be
 transferred during the next Hotsync.

    UserData.InstallUser(AutoInstallComboBox.ItemIndex, FilePathAndName);


 3. Support, feedback and bugs
 -----------------------------

 I do not "oficially" provide support for this
 software.  However, if you have any questions about
 it, please feel free to write to me at:

   adahm@cyberramp.net

 I will try to answer your questions promptly.  If you
 have any suggestions for improvement, please let me
 know also, as I will be more than happy to hear your
 opinions!

 If you find a bug in this class, please let me
 know by sending a description of the bug to:

   adahm@cyberramp.net

 I will correct all reported bugs as soon as possible.


 4. Revision History
 -------------------

 12/11/97: Version 1.1
  - Removed several useless units from the Uses clause, potentially
    decreasing the size of the executable by about 130k.

 11/15/97: Version 1.0
  - Initial Release.
