Advanced Delphi Systems- çeşitli 4

Yazdığınız makaleleri ve üyelerimizin işine yarayacağını düşündüğünüz kodlarınızı gönderebilirsiniz. Bu foruma soru sormayın!
Cevapla
Kullanıcı avatarı
Asri
Kıdemli Üye
Mesajlar: 767
Kayıt: 16 Eyl 2003 09:54
Konum: istanbul

Advanced Delphi Systems- çeşitli 4

Mesaj gönderen Asri »

Aşağıdaki unit'i unit1'de uses olarak ekleyip bu unit içindeki procedure ve function'ları kullanbilirsiniz.

Bu unit program çeşitli işlemlerde kullanılır.

Kod: Tümünü seç

Unit ads_Com;

Interface

Uses
  SysUtils, StdCtrls, Dialogs, Forms, ExtCtrls,
  Messages, WinProcs, WinTypes, Buttons, Classes,
  DB, DBTables, Controls, Grids,  IniFiles, Graphics,
  ShellAPI, FileCtrl, wininet {$IFNDEF WIN32}, ToolHelp{$ENDIF};

Const RunOutsideIDE_ads        = True;
Const RunOutsideIDEDate_ads    = '12/1/98';
Const RunOutsideIDECompany_ads = 'Advanced Delphi Systems';
Const RunOutsideIDEPhone_ads   = 'Please purchase at (301) 840-1554';

{!~ ABOUTBOX_ADS
This procedure presents an About Box.
TITLE The title is set by the AboutTitle parameter.

INFORMATION
The information displayed in the about box is pulled directly
from the executable.  The programmer can configure this information
in Delphi by doing the following:
(1) in Delphi go to Project|Options|VersionInfo and make sure
that the check box for Include Version information in project
is checked.
(2)Auto-increment build number should also be checked so
that each time a build-all is run the version number is
automatically updated.  This makes life simple and in automatic.
(3)Edit/Add items in the section at the bottom of this page
where key and value items are listed.  Whatever you put in
this section is what will appear in the about box.
(2) Save the project and recompile
(3) The newly edited information will appear in the about box.

IMAGE
The Application Icon is presented as the image. To change the
image do the following:
(1) in Delphi go to Project|Options|Application|Load Icon
and select an Icon for the application
(2) Save the project and
recompile
(3) The newly selected Icon will appear in the about box.

SIZE
The About box size can be passed as the parameters AboutWidth
and AboutHeight.  If however you wish to have the procedure
size the About Box automatically set these two parameters to
zero.  }
Procedure AboutBox_ads(
  AboutTitle  : String;
  AboutWidth  : Integer;
  AboutHeight : Integer
  );

{!~ Add source table to destination table}
Function AddTables(
           const
           SourceDatabaseName,
           SourceTable,
           DestDatabaseName,
           DestinationTable: string): Boolean;

{!~ Closes a Windows Application:
  ExecutableName is usually the name of the executable
  WinClassName can be found by inspecting the messaging
    using WinSight that ships with Delphi}
procedure AppClose(ExecutableName,WinClassName : String);

{!~ Executes a Windows Application:
  ExecutableName is usually the name of the executable
  WinClassName can be found by inspecting the messaging
    using WinSight that ships with Delphi

  If the application is already running this function
  brings it to the front}
procedure AppExecute(
  ExecutableName : String;
  WinClassName   : String);

{!~ Returns the handle of a Windows Application}
function AppHandle(WinClassName : String): THandle;

{!~ Returns True if Application is running, False otherwise}
Function AppIsRunning(AppName: String): Boolean;

{!~ a subroutine of AppExecute}
Function AppLoad(const ExecutableName: string; show : word) : THandle;

{!~ a subroutine of AppExecute}
function AppSwitchTo(WinClassName   : String): boolean;

{!~ A SubRoutine of AppClose}
Function AppTerminate(AppName: String): Boolean;

{!~ Handles button alignment}
procedure ButtonReSizer(
  ButtonBase      : TPanel;
  ButtonSlider    : TPanel;
  ButtonWidth     : Integer;
  ButtonSpacer    : Integer;
  ButtonsReSize   : Boolean;
  ButtonsAlignment: TAlignment;
  Beveled         : Boolean);

{!~ Changes Directory}
Function CD(DirName: String): Boolean;

{!~ Centers a child component on a TPanel}
procedure CenterChild(Panel : TPanel);

{!~ Horizontally Centers all children of a TPanel }
procedure CenterChildren_H(Panel : TPanel);

{!~ Centers a Control Inside its Parent}
Procedure CenterComponent(ParentControl, ChildControl: TControl);

{!~ Centers A Form}
Procedure CenterForm(f : TForm);

{!~ Centers A Form Horizontally}
Procedure CenterFormHorizontally(f : TForm);

{!~ Centers A Form Vertically}
Procedure CenterFormVertically(f : TForm);

{!~ Sets The Dimensions Of A Component}
procedure CompDimensions(
            Comp: TControl;
            TopDim,
            LeftDim,
            HeightDim,
            WidthDim: Integer);

{!~ Converts an integer value to its binary equivalent
as a ShortString }
Function ConvertIntegerToBinaryString(Int, Length : Integer) : ShortString;

{!~ Converts A PChar To String}
Function ConvertPCharToString(PCharValue: PChar): String;

{!~ Converts A String To Char}
Function ConvertStringToChar(InputString: String; CharPosition: Integer): Char;

{!~ Converts A String To Integer, If An Error Occurrs The Function Returns -0}
Function ConvertStringToInteger(StringValue: String): Integer;

{!~ Converts A String To A PChar, If An Error Occurrs The Function Returns 0}
Function ConvertStringToPChar(StringValue: String): PChar;

{!~ Converts a word value to its binary equivalent
as a ShortString }
Function ConvertWordToBinaryString(InputWord : Word; Length : Integer) : ShortString;

{!~ Copies a directory regardless of whether the directory is filled or has subdirectories.
This is a powerful utility.  If the operation is successful then True is
returned, False otherwise.  If the destination directory already exists the process
fails and returns false.}
Function CopyDirectory(
  SourceDirectoryName: String;
  DestDirectoryName: String): Boolean;

{!~ Copies A File}
Function CopyFile(FromFile,ToFile:String): Boolean;

{!~ Copy Files}
Function CopyFiles(FromPath,ToPath,FileMask: String): Boolean;

{!~ Creates a new table from a Query.
 Complex joins can be output to a new table.}
Function CreateTableFromQuery(
            Query: TQuery;
            NewTableName,
            TableDatabaseName: String): Boolean;

{!~ Returns The Number Of Days In The Month}
Function Date_DaysInMonth(DateValue: TDateTime): Integer;

{!~ Returns The First Day Of The Month}
Function Date_FirstDayOfNextMonth(DateValue: TDateTime): TDateTime;

{Returns The First Day Of the Week, i.e., Sunday, As A TDateTime.  If an
error occurs then zero is returned.}
Function Date_FirstDayOfWeek(DateValue: TDateTime): TDateTime;

{Returns The First Day Of Last Week, i.e., Sunday, As A TDateTime.  If an
error occurs then zero is returned.}
Function Date_FirstDayOfLastWeek(DateValue: TDateTime): TDateTime;

{Returns The First Day Of next Week, i.e., Sunday, As A TDateTime.  If an
error occurs then zero is returned.}
Function Date_FirstDayOfNextWeek(DateValue: TDateTime): TDateTime;

{!~ Returns The Last Day Of The Month}
Function Date_LastDayOfMonth(DateValue: TDateTime): TDateTime;

{!~ Returns The Month}
Function Date_Month(DateValue: TDateTime): Integer;

{!~ Returns The Next Month}
Function Date_MonthNext(DateValue: TDateTime): Integer;

{!~ Returns The Prior Month}
Function Date_MonthPrior(DateValue: TDateTime): Integer;

{!~ Returns A Date N Days Different Than
The Input Date}
Function Date_MoveNDays(
  DateValue    : TDateTime;
  DateMovement : Integer): TDateTime;

{!~ Returns The Next Day As A TDateTime}
Function Date_NextDay(DateValue: TDateTime): TDateTime;

{!~ Returns The Next Week As A TDateTime}
Function Date_NextWeek(DateValue: TDateTime): TDateTime;

{!~ Returns The Prior Day As A TDateTime}
Function Date_PriorDay(DateValue: TDateTime): TDateTime;

{!~ Returns The Prior Week As A TDateTime}
Function Date_PriorWeek(DateValue: TDateTime): TDateTime;

{!~ Add source query to destination table}
Procedure DBAddQueryToTable(
      DataSet : TQuery;
      const
      DestDatabaseName,
      DestinationTable: string);

{!~ Add source table to destination table}
Function DBAddTables(
      const
      SourceDatabaseName,
      SourceTable,
      DestDatabaseName,
      DestinationTable: string): Boolean;

{!~ Copies Field A To Field B.}
function DBCopyFieldAToB(
            DatabaseName,
            TableName,
            SourceField,
            DestField: String): Boolean;

{!~ Copies SourceTable To DestTable.
If DestTable exists it is deleted}
Function DBCopyTable(
            SourceDatabaseName,
            SourceTable,
            DestDatabaseName,
            DestTable: String): Boolean;

{!~ Copies Table A To Table B.  If Table B exists it
is emptied}
Function DBCopyTableAToB(
            SourceDatabaseName,
            SourceTable,
            DestDatabaseName,
            DestTable: String): Boolean;

{!~ Copies a table from the source to the destination.
If the destination table exists the function will not
throw an error, the existing table will be replaced with the new
table.}
Function DBCopyTableToServer(
  SourceDatabaseName   : String;
  SourceTableName      : String;
  DestDatabaseName     : String;
  DestTableName        : String): Boolean;

{!~ Creates an empty table with indices by borrowing the structure
of a source table. Source and destination can be remote or local
tables.  If the destination table exists the function will not
throw an error, the existing table will be replaced with the new
table.}
Function DBCreateTableBorrowStr(
  SourceDatabaseName   : String;
  SourceTableName      : String;
  DestDatabaseName     : String;
  DestTableName        : String): Boolean;

{!~ Creates a new table from a Query.
 Complex joins can be output to a new table.}
Function DBCreateTableFromQuery(
            Query: TQuery;
            NewTableName,
            TableDatabaseName: String): Boolean;

{!~ Deletes A Table}
Function DBDeleteTable(const DatabaseName, TableName : string):Boolean;

{!~ Drops A Table}
Function DBDropTable(const DatabaseName, TableName : string):Boolean;

{!~ Empties a table of all records}
Function DBEmptyTable(
           const DatabaseName,
           TableName : string): Boolean;

{!~ Returns the field Name as a String.  If there
is an error, the table doesn't exist, the field doesn't
exist or some other reason '' is returned.}
Function DBFieldNameByNo(
  DatabaseName  : String;
  TableName     : String;
  FieldNo       : Integer): String;

{!~ Copies Table Field Names to a TStrings object.
Returns the true if successful.  If there
is an error, the DatabaseName doesn't exist, the table doesn't
exist or some other reason False is returned.  }
Function DBFieldNamesToTStrings(
  DatabaseName : String;
  TableName    : String;
  Strings      : TStrings): Boolean;

{!~ Returns Field Names shared by 2 tables as a string.
Fields are separated by commas with no trailing comma.}
Function DBFieldNamesCommonToString(
  DatabaseName1 : String;
  TableName1    : String;
  DatabaseName2 : String;
  TableName2    : String): String;

{!~ Copies Field Names shared by 2 tables to a TStrings object.
Returns true if successful.  If there
is an error, the DatabaseName doesn't exist, the table doesn't
exist or some other reason False is returned.  }
Function DBFieldNamesCommonToTStrings(
  DatabaseName1 : String;
  TableName1    : String;
  DatabaseName2 : String;
  TableName2    : String;
  Strings       : TStrings): Boolean;

{!~ Returns the field Number as an integer.  If there
is an error, the table doesn't exist, the field doesn't
exist or some other reason -1 is returned.}
Function DBFieldNo(DatabaseName, TableName, FieldName: String): Integer;

{!~ Returns the database field Size as an integer.  If there
is an error, the table doesn't exist, the field doesn't
exist or some other reason 0 is returned.}
Function DBFieldSize(DatabaseName, TableName, FieldName: String): Integer;

{!~ Returns the database field type as a string.  If there
is an error, the table doesn't exist, the field doesn't
exist or some other reason a null string is returned.}
Function DBFieldType(DatabaseName, TableName, FieldName: String): String;

{!~ Returns the database field type as a string.  If there
is an error, the table doesn't exist, the field doesn't
exist or some other reason a null string is returned.}
Function DBFieldTypeByNo(DatabaseName, TableName: String; FieldNo: Integer): String;

{!~ Replace all the values in a field that match a
condition value with a new value}
procedure DBGlobalStringFieldChange(
  const DatabaseName,
  TableName,
  FieldName,
  NewValue : string);

{!~ Replace all the values in a field with a new value}
procedure DBGlobalStringFieldChangeWhere(
  const DatabaseName,
  TableName,
  FieldName,
  CurrentValue,
  NewValue : string);

{!~ Replace values in a field (NewValueField) with NewValue
based on a where condition in CurrentValueField with a value
of CurrentValue}
procedure DBGlobalStringFieldChangeWhere2(
  const DatabaseName,
  TableName,
  NewValueField,
  NewValue,
  CurrentValueField,
  CurrentValue: string);

{!~ Inserts matching fields in a destination table.
Source Table records are deleted if the record was inserted properly.
Records unsuccessfully inserted are retained and the problems recorded
in the ErrorField.}
Function DBInsertMatchingFields(
           const
           SourceDatabaseName,
           SourceTable,
           DestDatabaseName,
           DestinationTable,
           ErrorField: string): Boolean;

{!~ Copies Table Key Field Names to a TStrings object.
Returns the true if successful.  If there
is an error, the DatabaseName doesn't exist, the table doesn't
exist or some other reason False is returned.  }
Function DBKeyFieldNamesToTStrings(
  DatabaseName : String;
  TableName    : String;
  Strings      : TStrings): Boolean;

{!~ Presents a lookup Dialog to the user.  The selected
value is returned if the user presses OK and the Default
value is returned if the user presses Cancel unless the
TStringList is nil in which case a blank string is returned}
Function DBLookUpDialog(
  Const DataBaseName  : String;
  Const TableName     : String;
  Const FieldName     : String;
  Const SessionName   : String;
  Const DefaultValue  : String;
  const DialogCaption : string;
  const InputPrompt   : string;
  const DialogWidth   : Integer
  ): String;

{!~ Returns the median value for a column in a table
as type single}
Function DBMedianSingle(
      const DatabaseName,
      TableName,
      FieldName,
      WhereString
      : string): Single;

{!~ Moves SourceTable From SourceDatabaseName
 To DestDatabasename.  If a table exists
 with the same name at DestDatabaseName it
 is overwritten.}
Function DBMoveTable(
            SourceTable,
            SourceDatabaseName,
            DestDatabaseName: String): Boolean;

{!~ Returns the number of fields in a table}
Function DBNFields(DatabaseName, TableName: String): Integer;

{!~ Returns the next key value when the table keys are
numbers as strings, e.g., '   12' key would return
'   13'}
Function DBNextAlphaKey(DatabaseName, TableName, FieldName: String):String;

{!~ Returns the next key value when the table keys are
integers, e.g., 12 key would return 13}
Function DBNextInteger(
  DatabaseName,
  TableName,
  FieldName: String):LongInt;

{!~ ReKeys a Paradox Table to the first N fields}
Function DBParadoxCreateNKeys(
  DatabaseName : String;
  TableName    : String;
  NKeys        : Integer): Boolean;

{!~ ReNames a table}
Function DBReNameTable(
  DatabaseName,
  TableNameOld,
  TableNameNew: String): Boolean;

{!~ Applies BatchMode Types As Appropriate To
Source and Destination Tables}
Function DBRecordMove(
           SourceDatabaseName,
           SourceTable,
           DestDatabaseName,
           DestTable: String;
           BMode: TBatchMode): Boolean;

{!~ Returns True If The Tables Have Identical Structures, False Otherwise.
If 1 Local Table is involved then Indices are ignored!!!!!!}
Function DBSchemaSame(const
           DatabaseName1,
           Table1,
           DatabaseName2,
           Table2: string): Boolean;

{$IFDEF WIN32}
{!~ Returns a new TSession Object.  Nil is returned if something
goes wrong.}
Function DBSessionCreateNew: TSession;
{$ENDIF}

{!~ Returns a value for use in a sql where clause with the
appropriate Quoting of the value based on its datatype.  If
an error occurs the original string value is returned unchanged}
Function DBSqlValueQuoted(
           const
           DatabaseName,
           TableName,
           FieldName,
           FieldValue: string): String;

{!~ Subtracts the records in the source
 table from the destination table}
Function DBSubtractTable(
           const
           SourceDatabaseName,
           SourceTable,
           DestDatabaseName,
           DestinationTable: string): Boolean;

{!~ Trims blank spaces from the Left of the string}
Function DBTrimBlanksLeft(
  DatabaseName : String;
  TableName    : String;
  FieldName    : String): Boolean;

{!~ Trims blank spaces from the right of the string}
Function DBTrimBlanksRight(
  DatabaseName : String;
  TableName    : String;
  FieldName    : String): Boolean;

{!~ Updates matching fields in a destination table.
Source Table records are deleted if the record was updated properly.
Records unsuccessfully updated are retained and the problems recorded
in the ErrorField.}
Function DBUpdateMatchingFields(
           const
           SourceDatabaseName,
           SourceTable,
           DestDatabaseName,
           DestinationTable,
           ErrorField: string;
           MsgPanel: TPanel;
           FilePath: String): Boolean;

{!~ Deletes all occurances of a Character in a String}
Function DeleteCharacterInString(InputCharacter,InputString: String): String;

{!~ Deletes Files}
Function DeleteFiles(FilePath,FileMask: String): Boolean;

{!~ Deletes all LineFeed Carriage Returns}
Function DeleteLineBreaks(const S: string): string;

{!~ Deletes all occurances of specified substring in a String}
Function DeleteSubStringInString(substring,InputString: String): String;

{Deletes all occurances of specified substring in a String and is case
insensitive.}
Function DeleteSubStringInStringNoCase(substring,InputString: String): String;

{!~ Deletes A Table}
Function DeleteTable(const DatabaseName, TableName : string):Boolean;

{!~ Checks whether Delphi is Running and
issues a message if the user doesn't have
the right to use the component}
procedure DelphiCheck(CanRunOutSide: Boolean);

{!~ Checks whether Delphi is Running and
issues a message if the user doesn't have
the right to use the component}
procedure DelphiChecker(
  CanRunOutSide   : Boolean;
  ComponentName   : String;
  OwnerName       : String;
  PurchaseMessage : String;
  ActivateDate    : String);

{!~ Returns True if delphi is running, False otherwise}
Function DelphiIsRunning: Boolean;

{!~ Completely deletes a directory regardless of whether the directory
is filled or has subdirectories.  No confirmation is requested so be careful.
This is a powerful utility.  If the operation is successful then True is
returned, False otherwise}
Function DelTree(DirectoryName: String): Boolean;

{!~ DIALOGABOUTBOX_ADS
This procedure presents an About Box.
TITLE The title is set by the AboutTitle parameter.

INFORMATION
The information displayed in the about box is pulled directly
from the executable.  The programmer can configure this information
in Delphi by doing the following:
(1) in Delphi go to Project|Options|VersionInfo and make sure
that the check box for Include Version information in project
is checked.
(2)Auto-increment build number should also be checked so
that each time a build-all is run the version number is
automatically updated.  This makes life simple and in automatic.
(3)Edit/Add items in the section at the bottom of this page
where key and value items are listed.  Whatever you put in
this section is what will appear in the about box.
(2) Save the project and recompile
(3) The newly edited information will appear in the about box.

IMAGE
The Application Icon is presented as the image. To change the
image do the following:
(1) in Delphi go to Project|Options|Application|Load Icon
and select an Icon for the application
(2) Save the project and
recompile
(3) The newly selected Icon will appear in the about box.

SIZE
The About box size can be pased as the parameters AboutWidth
and AboutHeight.  If however you wish to have the procedure
size the About Box automatically set these two parameters to
zero.  }
Procedure DialogAboutBox_ads(
  AboutTitle  : String;
  AboutWidth  : Integer;
  AboutHeight : Integer
  );

{!~ Presents a lookup Dialog to the user.  The selected
value is returned if the user presses OK and the Default
value is returned if the user presses Cancel unless the
TStringList is nil in which case a blank string is returned}
Function DialogDBLookUp(
  Const DataBaseName  : String;
  Const TableName     : String;
  Const FieldName     : String;
  Const SessionName   : String;
  Const DefaultValue  : String;
  const DialogCaption : string;
  const InputPrompt   : string;
  const DialogWidth   : Integer
  ): String;

{!~ Presents an input dialog that accepts a-z and A-Z only.
All other keys are thrown away except for the backspace key.
The result is returned as a string}
Function DialogInputBoxOnlyAToZ(
  const DialogCaption : string;
  const InputPrompt   : string;
  const DefaultValue  : string): string;

{!~ Presents an input dialog that accepts 0-9,-,+,".".
All other keys are thrown away except for the backspace key.
The result is returned as a string}
Function DialogInputBoxOnlyNumbers(
  const DialogCaption : string;
  const InputPrompt   : string;
  const DefaultValue  : string): string;

{!~ Presents an input dialog that accepts 0-9.
All other keys are thrown away except for the backspace key.
The result is returned as a string}
Function DialogInputBoxOnlyNumbersAbsolute(
  const DialogCaption : string;
  const InputPrompt   : string;
  const DefaultValue  : string): string;

{!~ Presents a lookup Dialog to the user.  The selected
value is returned if the user presses OK and the Default
value is returned if the user presses Cancel unless the
TStringList is nil in which case a blank string is returned}
Function DialogLookup(
  const DialogCaption : string;
  const InputPrompt   : string;
  const DefaultValue  : string;
  const Values        : TStringList
  ): string;


{!~ Returns Current Working Directory}
Function Directory: String;

{!~ Copies a directory regardless of whether the directory is filled or has subdirectories.
This is a powerful utility.  If the operation is successful then True is
returned, False otherwise.  If the destination directory already exists the process
fails and returns false.}
Function DirectoryCopy(
  SourceDirectoryName: String;
  DestDirectoryName: String): Boolean;

{!~ Moves a directory regardless of whether the directory is filled or has subdirectories.
This is a powerful utility.  If the operation is successful then True is
returned, False otherwise.}
Function DirectoryMove(
  SourceDirectoryName: String;
  DestDirectoryName: String): Boolean;

{!~ Drops A Table}
Function DropTable(const DatabaseName, TableName : string):Boolean;

{!~ Empties a directory of normal files.}
Function EmptyDirectory(Directory : String): Boolean;

{!~ Empties a table of all records}
Function EmptyTable(
           const DatabaseName,
           TableName : string): Boolean;

{!~ Returns the meaning of the given result code.  Error codes are for
Delphi 1.0.}
Function ErrorMeaning (ResultCode: Integer): string;

{Triggers an Executable to update itself.
Don't worry about the handle parameter,
just pass HANDLE which is the applications
handle. This can be run in the Application's
Main Form Create method.}
Function ExecutableUpdate(
  ExecutablePath : String;
  ExecutableName : String;
  InstallPath    : String;
  Handle         : THandle): Boolean;

{!~Executes an executable with no parameters}
Function ExecuteExe(FileName : String): Boolean;

{!~Executes an executable with parameters}
Function ExecuteExeParams(
  FileName    : String;
  ParamString : String;
  DefaultDir  : String): Boolean;

{!~ Loads a known file type using the appropriate
executable, e.g., WinWord for *.Doc, Paradox for *.db.}
Function ExecuteKnownFileType(
  Handle   : THandle;
  FileName : String): Boolean;

{!~ Returns The File Extension Without The Path, Name Or Period}
Function ExtractFileExtNoPeriod(FileString: String): String;

{!~ Returns The File Name Without The Path, Extension Or Period}
Function ExtractFileNameNoExt(FileString: String): String;

{!~ Returns the field Number as an integer.  If there
is an error, the table doesn't exist, the field doesn't
exist or some other reason 0 is returned.}
Function FieldNo(DatabaseName, TableName, FieldName: String): Integer;

{!~ Returns the database field Size as an integer.  If there
is an error, the table doesn't exist, the field doesn't
exist or some other reason 0 is returned.}
Function FieldSize(DatabaseName, TableName, FieldName: String): Integer;

{!~ Returns the database field type as a string.  If there
is an error, the table doesn't exist, the field doesn't
exist or some other reason a null string is returned.}
Function FieldType(DatabaseName, TableName, FieldName: String): String;

{!~ Returns the database field type as a string.  If there
is an error a null string is returned.}
Function FieldTypeFromDataSet(DataSet: TDataSet; FieldName: String): String;

{!~ Returns The Files Date Time Stamp as TDateTime}
Function FileDate(FileString: String): TDateTime;

{!~ Returns True is the filoe dates are the same, False otherwise.}
Function FileDatesSame(FileString1,FileString2: String): Boolean;

{!~ Returns The File Extension Without The Path, Name Or Period}
Function FileExt(FileString: String): String;

{!~ Returns the next available file name number as a string
in the format 00000001}
Function FileNextNumberName(
  Directory   : String;
  Mask        : String
  ): String;

{!~ Hides a directory.  Returns true if
successful and false otherwise}
Function DirectoryHide(Const FileString : String): Boolean;

{!~ Copies a directory regardless of whether the directory is filled or has subdirectories.
This is a powerful utility.  If the operation is successful then True is
returned, False otherwise.  If the destination directory already exists the process
fails and returns false.}
Function File_CopyDirectory(
  SourceDirectoryName: String;
  DestDirectoryName: String): Boolean;

{!~ Completely deletes a directory regardless of whether the directory
is filled or has subdirectories.  No confirmation is requested so be careful.
This is a powerful utility.  If the operation is successful then True is
returned, False otherwise}
Function File_DeleteDirectory(DirectoryName: String): Boolean;

{!~ Completely deletes a directory regardless of whether the directory
is filled or has subdirectories.  No confirmation is requested so be careful.
This is a powerful utility.  If the operation is successful then True is
returned, False otherwise}
Function File_DelTree(DirectoryName: String): Boolean;

{!~ Moves a directory regardless of whether the directory is filled or has subdirectories.
This is a powerful utility.  If the operation is successful then True is
returned, False otherwise.}
Function File_DirOperations_Detail(
  Action            : String;  //COPY, DELETE, MOVE, RENAME
  RenameOnCollision : Boolean; //Renames if directory exists
  NoConfirmation    : Boolean; //Responds "Yes to All" to any dialogs
  Silent            : Boolean; //No progress dialog is shown
  ShowProgress      : Boolean; //displays progress dialog but no file names
  FromDir           : String;  //From directory
  ToDir             : String   //To directory
  ): Boolean;

{!~ Returns the Creation Date for a file.}
Function File_GetCreationDate(FileName : String): TDateTime;

{!~ Returns the Date a file was last accessed.}
Function File_GetLastAccessDate(FileName : String): TDateTime;

{!~ Returns the Date a file was last modified.}
Function File_GetLastModifiedDate(FileName : String): TDateTime;

{!~ Returns the Long File Name of a file.}
Function File_GetLongFileName(FileName : String): String;

{!~ Returns the Short File Name of a file.}
Function File_GetShortFileName(FileName : String): String;

{!~ Completely deletes a directory regardless of whether the directory
is filled or has subdirectories.  No confirmation is requested so be careful.
This is a powerful utility.  If the operation is successful then True is
returned, False otherwise}
Function File_KillDirectory(DirectoryName: String): Boolean;

{!~ Moves a directory regardless of whether the directory is filled or has subdirectories.
This is a powerful utility.  If the operation is successful then True is
returned, False otherwise.}
Function File_MoveDirectory(
  SourceDirectoryName: String;
  DestDirectoryName: String): Boolean;

{!~ Completely deletes a directory regardless of whether the directory
is filled or has subdirectories.  No confirmation is requested so be careful.
This is a powerful utility.  If the operation is successful then True is
returned, False otherwise}
Function File_RemoveDirectory(DirectoryName: String): Boolean;

{!~ ReNames a directory regardless of whether the directory
is filled or has subdirectories.  No confirmation is requested so be careful.
This is a powerful utility.  If the operation is successful then True is
returned, False otherwise}
Function File_ReNameDirectory(
  OldDirectoryName: String;
  NewDirectoryName: String): Boolean;

{!~ Moves a File From Source To Destination}
Function FileMove(SourceFile, DestinationFile: String): Boolean;

{!~ Returns The File Name Without The Path, Extension Or Period}
Function FileName(FileString: String): String;

{!~ Returns The File Path Without The Name, Extension ,Period or trailing Backslash}
Function FilePath(FileString: String): String;

{!~ Returns The File size in bytes.  Does not work on a text file.}
Function FileNotTextSize(FileString: String): LongInt;

{!~ Populates a TStrings FileList with the files meeting selected
file attribute criteria in a directory.  The mask argument is a
standard DOS file argument like '*.*.  The InclDotFiles argument
allows the user to exclude the system files "." and ".." by
setting the value to False.  If the Intersection argument is set
to true then the result will reflect only those files that satisfy
all attribute criteria.  If Intersection is set to false then the
result will be a union of files that meet any of the criteria.}
Function FilesInDirDetail(
  FileList    : TStrings;
  Directory   : String;
  Mask        : String;
  Intersection: Boolean;
  IsReadOnly  : Boolean;
  IsHidden    : Boolean;
  IsSystem    : Boolean;
  IsVolumeID  : Boolean;
  IsDirectory : Boolean;
  IsArchive   : Boolean;
  IsNormal    : Boolean;
  InclDotFiles: Boolean): Boolean;

{!~ UnHides a directory.  Returns true if
successful and false otherwise}
Function DirectoryUnHide(Const FileString : String): Boolean;

{!~ Returns The Left Property To Center A Form}
Function FormCenterHorizontal(FormWidth: Integer): Integer;

{!~ Returns The Top Property To Center A Form}
Function FormCenterVertical(FormHeight: Integer): Integer;

{!~ Sets The Dimensions Of A Form}
procedure FormDimensions(
            Form: TForm;
            TopDim,
            LeftDim,
            HeightDim,
            WidthDim: Integer);

{!~ Returns the form's left value that will center the form horizontally}
Function  GetCenterFormLeft(FormWidth : Integer): Integer;

{!~ Returns the form's Top value that will center the form vertically}
Function  GetCenterFormTop(FormHeight : Integer): Integer;

{!~ Deletes a row in a TStringGrid}
procedure GridDeleteRow(RowNumber : Integer; Grid : TStringGrid);

{!~ Moves a row in a TStringGrid to the bottom of the grid}
procedure GridMoveRowToBottom(RowNumber : Integer; Grid : TStringGrid);

{!~ Causes an image to fade away.
Example code:
procedure TForm1.Button7Click(Sender: TObject);
begin
  Timer1.OnTimer := Button7Click;
  ImageFadeAway(
    Image1,
    Timer1,
    False);
end;}
Procedure ImageFadeAway(
  Image          : TImage;
  Timer          : TTimer;
  Transparent    : Boolean);

{!~ Causes an image to fade in.
Example code:
procedure TForm1.Button6Click(Sender: TObject);
begin
  Timer1.OnTimer := Button6Click;
  ImageFadeIn(
    Image1,
    Timer1,
    False);
end;}
Procedure ImageFadeIn(
  Image          : TImage;
  Timer          : TTimer;
  Transparent    : Boolean);

{!~ Causes an image to fade in and out.
Setting cycles to 0 makes it continuous.
Example code:
procedure TForm1.Button10Click(Sender: TObject);
begin
  Timer1.OnTimer := Button10Click;
  ImageFadeInAndOut(
    Image1,
    Timer1,
    False,
    0);
end;}
Procedure ImageFadeInAndOut(
  Image          : TImage;
  Timer          : TTimer;
  Transparent    : Boolean;
  Cycles         : Integer);

{!~ Causes an image to flip horizontally.
Setting cycles to 0 makes it continuous.
Example code:
procedure TForm1.Button4Click(Sender: TObject);
begin
  Timer1.OnTimer := Button4Click;
  ImageFlipHoriz(
    Image1,
    Timer1,
    False,
    3,
    3);
end;}
Procedure ImageFlipHoriz(
  Image          : TImage;
  Timer          : TTimer;
  Transparent    : Boolean;
  Const MinLeft  : Integer;
  Cycles         : Integer);

{!~ Causes an image to flip vertically.
Setting cycles to 0 makes it continuous.
Example code:
procedure TForm1.Button5Click(Sender: TObject);
begin
  Timer1.OnTimer := Button5Click;
  ImageFlipVert(
    Image1,
    Timer1,
    False,
    3,
    3);
end;}

Procedure ImageFlipVert(
  Image          : TImage;
  Timer          : TTimer;
  Transparent    : Boolean;
  Const MinTop   : Integer;
  Cycles         : Integer);

{!~ Causes an image to flutter horizontally.
Setting cycles to 0 makes it continuous.
Example code:
procedure TForm1.Button9Click(Sender: TObject);
begin
  Timer1.OnTimer := Button9Click;
  ImageFlutterHoriz(
    Image1,
    Timer1,
    False,
    0);
end;}
Procedure ImageFlutterHoriz(
  Image          : TImage;
  Timer          : TTimer;
  Transparent    : Boolean;
  Cycles         : Integer);

{!~ Causes an image to flutter vertically.
Example code:
procedure TForm1.Button8Click(Sender: TObject);
begin
  Timer1.OnTimer := Button8Click;
  ImageFlutterVert(
    Image1,
    Timer1,
    False,
    0);
end;}
Procedure ImageFlutterVert(
  Image          : TImage;
  Timer          : TTimer;
  Transparent    : Boolean;
  Cycles         : Integer);

{!~ Causes an image to pulsate in and out.
Example code:
procedure TForm1.Button11Click(Sender: TObject);
begin
  Timer1.OnTimer := Button11Click;
  ImagePulsate(
    Image1,
    Timer1,
    False,
    0);
end;}
Procedure ImagePulsate(
  Image          : TImage;
  Timer          : TTimer;
  Transparent    : Boolean;
  Cycles         : Integer);

{!~ Returns the ini value for a variable (IntegerName)
in the ini section (IniSection) of the ini file (TheIniFile).}
Function IniGetIntegerValue(
  TheIniFile            : String;
  IniSection            : String;
  IntegerName           : String;
  DefaultInteger        : Integer): Integer;

{!~ Returns the ini value for a variable (StringName)
in the ini section (IniSection) of the ini file (TheIniFile).}
Function IniGetStringValue(
  TheIniFile            : String;
  IniSection            : String;
  StringName            : String;
  DefaultString         : String): String;

{!~ Sets a variable (IntegerName) in the ini section (IniSection)
of the ini file (TheIniFile) with the value (IntegerValue).
If an exception is thrown the function returns False,
True otherwise.}
Function IniSetIntegerValue(
  TheIniFile            : String;
  IniSection            : String;
  IntegerName           : String;
  IntegerValue          : Integer): Boolean;

{!~ Sets a variable (StringName) in the ini section (IniSection)
of the ini file (TheIniFile) with the value (StringValue).
If an exception is thrown the function returns False,
True otherwise.}
Function IniSetStringValue(
  TheIniFile            : String;
  IniSection            : String;
  StringName            : String;
  StringValue           : String): Boolean;

{!~ Updates an ini file from a TStringList}
Procedure IniUpdateFromTStringList(
  TheIniFile            : String;
  IniSection            : String;
  StringListName        : String;
  CountField            : String;
  StringList            : TStringList);

{!~ Updates a TStringList from an ini file}
Procedure IniUpdateTStringList(
  TheIniFile            : String;
  IniSection            : String;
  StringListName        : String;
  CountField            : String;
  StringList            : TStringList);

{!~ Presents an input dialog that accepts a-z and A-Z only.
All other keys are thrown away except for the backspace key.
The result is returned as a string}
Function InputBoxOnlyAToZ(
  const DialogCaption : string;
  const InputPrompt   : string;
  const DefaultValue  : string): string;

{!~ Presents an input dialog that accepts 0-9,-,+,".".
All other keys are thrown away except for the backspace key.
The result is returned as a string}
Function InputBoxOnlyNumbers(
  const DialogCaption : string;
  const InputPrompt   : string;
  const DefaultValue  : string): string;

{!~ Presents an input dialog that accepts 0-9.
All other keys are thrown away except for the backspace key.
The result is returned as a string}
Function InputBoxOnlyNumbersAbsolute(
  const DialogCaption : string;
  const InputPrompt   : string;
  const DefaultValue  : string): string;

{!~ Empties the Temporary Internet Files directory}
procedure Internet_EmptyCacheDirectories(
  TemporaryInternetDirectory : String);

{!~ The purpose of this procedure is to extract URL information from
web pages stored in the Temporary Internet Files Directory.

The URL's gathered by this procedure are stored in a new HTML page given
by the OutputFile argument.

This procedure needs a working directory designated
by the WorkingDirectoryName argument.  This working directory should
be for the exclusive use of this procedure because all files in the
directory are deleted at the beginning of the process.

The location of the Temporary Internet Files Directory is provided by
the TemporaryInternetDirectory argument.

A number of boolean options are provided in this procedure:
  SortByLabels           : Sort the Results by the <a Tag Labels.
  EliminateDuplicates    : Eliminate duplicates.
  DiscardRelativePaths   : Discard URL's with relative paths.
  EmptyCacheWhenDone     : Empty the Internet Cache when the process
                           is completed.

Some URL's can be discarded from the results by identifying a
string that would trigger the disposal of the URL.  There is no limit
how many of these string triggers can be used.  To pass these triggers
to the procedure use a TStringList with one trigger per line.  The
TStringList should be passed to the EliminateURLsContaining argument.

Example:

procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
  Internet_GetURLsFromCachePages(
    Edit1.Text,                       //TemporaryInternetDirectory : String;
    GlobalExecutablePath+Edit2.Text,  //WorkingDirectoryName       : String;
    Edit3.Text,                       //OutputFile                 : String;
    CheckBox1.Checked,                //SortByLabels               : Boolean;
    CheckBox2.Checked,                //EliminateDuplicates        : Boolean;
    CheckBox3.Checked,                //DiscardRelativePaths       : Boolean;
    CheckBox4.Checked,                //EmptyCacheWhenDone         : Boolean;
    Memo1.Lines);                     //EliminateURLsContaining    : TStrings);
end;
}
procedure Internet_GetURLsFromCachePages(
  TemporaryInternetDirectory : String;
  WorkingDirectoryName       : String;
  OutputFile                 : String;
  SortByLabels               : Boolean;
  EliminateDuplicates        : Boolean;
  DiscardRelativePaths       : Boolean;
  EmptyCacheWhenDone         : Boolean;
  EliminateURLsContaining    : TStrings);

{!~ Returns True if DateString is a valid date,
False otherwise.}
Function IsDate(DateString: String): Boolean;

{!~ Returns True if Delphi is currently running}
Function IsDelphiRunning: Boolean;

{!~ Tests Directory Existence}
Function IsDir(IsDirPath: String): Boolean;

{!~ Returns True If Directory Is Empty, False Otherwise}
Function IsDirEmpty(DirName: String): Boolean;

{!~ Tests whether a TDataSource is empty, i.e., has no records }
Function IsEmptyDataSource(DS: TDataSource): Boolean;

{!~ Tests whether a TQuery is empty, i.e., has no records }
Function IsEmptyTQuery(Query: TQuery): Boolean;

{!~ Tests whether a TTable is empty, i.e., has no records }
Function IsEmptyTTable(Table: TTable): Boolean;

{!~ Tests whether a table is empty, i.e., has no records }
Function IsEmptyTable(DatabaseName, TableName: String): Boolean;

{Tests whether a table is empty, i.e., has no records }
Function IsEmptyTable2(DatabaseName, TableName: String): Boolean;

{!~ Returns True If DatabaseName:TableName:FieldName Exists,
False Otherwise}
Function IsField(DatabaseName, TableName, FieldName: String): Boolean;

{!~ Returns True If DatabaseName:TableName:FieldName
 Exists and is Keyed, False Otherwise}
Function IsFieldKeyed(DatabaseName, TableName, FieldName: String): Boolean;

{!~ Returns True If The File Exists, False Otherwise}
Function IsFile(DirName: String): Boolean;

{!~ Copies an internet URL to a file.  Returns True
if successful, False otherwise.  The source URL can
be a remote http address or it can be a local file.}
Function InternetCopyURLToFile(
  SourceURL    : String;
  DestFile     : String;
  ShowMessages : Boolean;
  StatusPanel  : TPanel
  ): Boolean;

{!~ Returns the Base URL of a URL address.  The source
URL can be a remote http address or it can be a local
file.}
Function InternetGetBaseURL(URL : String): String;

{!~ Tests for the existence of a URL.  True is returned
if the URL exists and False otherwise.  The source URL
can be a remote http address or it can be a local file.}
Function InternetIsUrl(URL : String): Boolean;

{!~ Returns True If The Record Exists, False Otherwise}
Function IsRecord(
  DatabaseName : String;
  TableName    : String;
  TableKeys    : TStringList;
  KeyValues    : TStringList): Boolean;

{!~ Returns True If The Tables Have Identical Structures, False Otherwise.
If 1 Local Table is involved then Indices are ignored!!!!!!}
Function IsSchemaSame(const
           DatabaseName1,
           Table1,
           DatabaseName2,
           Table2: string): Boolean;

{!~ Returns True If The Tables Have Identical Structures, False Otherwise.
If 1 Local Table is involved then Indices are ignored!!!!!!}
Function IsStructureSame(const
           DatabaseName1,
           Table1,
           DatabaseName2,
           Table2: string): Boolean;

{!~ Returns True If The Table Exists, False Otherwise.}
Function IsTable(DatabaseName, TableName: String): Boolean;

{!~ Returns True If DatabaseName:TableName
Exists and has a primary key, False Otherwise}
Function IsTableKeyed(DatabaseName, TableName: String): Boolean;

{!~ Throws away all keys except letters}
Procedure KeyPressOnlyLettersAbsolute(Var Key: Char);

{!~ Throws away all keys except 0-9,-,+,.}
Procedure KeyPressOnlyNumbers(Var Key: Char);

{!~ Throws away all keys except 0-9}
Procedure KeyPressOnlyNumbersAbsolute(Var Key: Char);

{!~ Throws away all keys except a-z and A-Z}
Procedure KeyPressOnlyAToZ(Var Key: Char);

{!~ Completely deletes a directory regardless of whether the directory
is filled or has subdirectories.  No confirmation is requested so be careful.
This is a powerful utility.  If the operation is successful then True is
returned, False otherwise}
Function KillDirectory(DirectoryName: String): Boolean;

{!~ Returns The Length Of The String}
Function Len(InputString: String): Integer;

{!~ Throws away all characters except letters}
Function LettersOnlyAbsolute(InputString: String): String;

{!~ Presents a lookup Dialog to the user.  The selected
value is returned if the user presses OK and the Default
value is returned if the user presses Cancel unless the
TStringList is nil in which case a blank string is returned}
Function LookupDialog(
  const DialogCaption : string;
  const InputPrompt   : string;
  const DefaultValue  : string;
  const Values        : TStringList
  ): string;

{!~ Returns a string converted to lower case}
Function Lower(InputString: String): String;

{!~ Makes A Directory}
Function MD(DirName: String): Boolean;

{!~ Returns the larger of two numbers}
Function Max(Number1, Number2: Single): Single;

{!~ Returns the smaller of two numbers}
Function Min(Number1, Number2: Single): Single;

{!~ Returns the smaller of two numbers}
Function Min_I(Number1, Number2: Integer): Integer;

{!~ Moves a directory regardless of whether the directory is filled or has subdirectories.
This is a powerful utility.  If the operation is successful then True is
returned, False otherwise.}
Function MoveDirectory(
  SourceDirectoryName: String;
  DestDirectoryName: String): Boolean;

{!~ Moves SourceTable From SourceDatabaseName
 To DestDatabasename.  If a table exists
 with the same name at DestDatabaseName it
 is overwritten.}
Function MoveTable(
            SourceTable,
            SourceDatabaseName,
            DestDatabaseName: String): Boolean;

{!~ Presents a Message Dialog}
procedure Msg(Msg: String);

{!~ Returns the number of fields in a table}
Function NFields(DatabaseName, TableName: String): Integer;

{!~ Converts a string to an Extended floating point number}
Function NumVal(InputString: String): Extended;

{!~ Throws away all characters except 0-9,-,+,.}
Function NumbersOnly(InputString: String): String;

{!~ Throws away all characters except 0-9}
Function NumbersOnlyAbsolute(InputString: String): String;

{!~ Sets or unsets beveling in a panel}
Procedure PanelBevel(Beveled : Boolean; Panel: TPanel);

{!~ Returns the constant pi as a real number}
Function Pi_Real: Real;

{!~ Increments the screen cursor to show progress}
procedure ProgressScreenCursor;

{!~ Returns the Proper form of a string, i.e., each word
starts with a capitalized letter and all subsequent
letters are lowercase}
Function Proper(S : String): String;

{!~ Purges files from the internet cache}
Procedure PurgeInternetCache(
  MainForm   : TForm;
  WinDir     : String;
  IntTempDir : String);

{!~ Removes A Directory}
Function RD(DirName: String): Boolean;

{!~ Returns A PseudoRandom Number Between 0 And 1}
Function Rand: Integer;

{!~ Loads A Random Image}
Procedure RandImage(ImageControl: TImage;
                    DirPath,
                    FileStub,
                    FileExt: String;
                    ImageMin,
                    ImageMax: Integer);

{!~ Returns A Random Number}
Function RandomInteger(RandMin, RandMax: Integer): Integer;

{!~ ReNames a directory regardless of whether the directory
is filled or has subdirectories.  No confirmation is requested so be careful.
This is a powerful utility.  If the operation is successful then True is
returned, False otherwise}
Function ReNameDir(OldDirName, NewDirName: String): Boolean;

{!~ ReNames a directory regardless of whether the directory
is filled or has subdirectories.  No confirmation is requested so be careful.
This is a powerful utility.  If the operation is successful then True is
returned, False otherwise}
Function ReNameDirectory(
  OldDirectoryName: String;
  NewDirectoryName: String): Boolean;

{!~ Replaces all occurances of a character in a string
with a new character}
Function ReplaceCharInString(S,OldChar,NewChar :String): String;

{!~ Replaces all occurances of a Character in a String}
Function ReplaceCharacterInString(
           OldChar,
           NewChar,
           InputString: String): String;

{Replaces all occurances of specified substring in a String.  This will have problems if
the OldSubString is Contained in the NewSubstring.  This is case sensitive.}
Function ReplaceSubStringInString(OldSubString,NewSubString,InputString: String): String;

{Replaces all occurances of specified substring in a String.  This will have problems if
the OldSubString is Contained in the NewSubstring.  This is case insensitive.}
Function ReplaceSubStringInStringNoCase(OldSubString,NewSubString,InputString: String): String;

{!~ Implements final resize tuning}
Procedure ReSizeTuner(ComponentName : String);

{!~ Scales a Form To A Particular Resolution}
Procedure ScaleForm(F: TForm;ScreenWidth, ScreenHeight: LongInt);

{!~ Sets all Children of a TPanel to the same width}
procedure SetChildWidths(Panel : TPanel);

{!~ Sets a File Date.}
Function SetFileDate(
  Const FileName : String;
  Const FileDate : TDateTime): Boolean;

{!~ Pads or truncates a String and Justifies Left if StrJustify=True}
Function StringPad(
  InputStr,
  FillChar: String;
  StrLen: Integer;
  StrJustify: Boolean): String;

{!~ All matches are added to the Stringlist.}
Function String_GrepAllToStringList(
  Source                  : String;   //The input string
  StartTag                : String;   //The start tag
  EndTag                  : String;   //The end tag
  Containing              : String;   //A match must contain this string
  Var StringList          : TStringList;   //A List of Matches
  CaseSensitiveTags       : Boolean;  //True if tags are casesensitive
  CaseSensitiveContaining : Boolean   //True if Containing string is casesensitive
  ): Boolean;                         //True if a match was found

{!~ Returns the contents of a string between two tags.  The tag
information is not returned.  Finding the tags is case sensitive.}
Function String_Grep_Contents(Source, StartTag, EndTag: String): String;

{!~ This is a full featured grep function.  All data associated
with the grep operation is returned.  The substring before the
match section is stored in the BeforeString variable.  The Match
Substring is stored in two variables.  The variable MatchwithTags
stores the match substring wrapped in the Start and End Tags.
The variable MatchWithoutTags stores the match substring without
the Start and End Tags. CaseSensitivity can be toggled for both
the tags and the Containing String using the booleans
CaseSensitiveTags and CaseSensitiveContaining. For a match to be
successful it must satisfy all criteria.  If the Containing String
is null this criteria is not applied.
}
Function String_Grep_Detail(
  Source                  : String;   //The input string
  StartTag                : String;   //The start tag
  EndTag                  : String;   //The end tag
  Containing              : String;   //A match must contain this string
  Var BeforeString        : String;   //The substring prior to the match
  Var MatchWithTags       : String;   //The match string including tags
  Var MatchWithoutTags    : String;   //the match string without the tags
  Var AfterString         : String;   //The substring after the match with tags
  CaseSensitiveTags       : Boolean;  //True if tags are casesensitive
  CaseSensitiveContaining : Boolean   //True if Containing string is casesensitive
  ): Boolean;                         //True if a match was found

{!~ The String_LineFeed_Format function adjusts all line breaks in the given
string "SourceString" to be true CR/LF sequences. The function changes any
CR characters not followed by a LF and any LF characters not preceded by a
CR into CR/LF pairs. It also converts LF/CR pairs to CR/LF pairs. The LF/CR
pair is common in Unix text files.}
Function String_LineFeed_Format(SourceString : String): String;

{!~ Inserts a Carriage Return/Line Feed at the index position.}
Function String_LineFeed_Insert(SourceString : String; Index : Integer): String;

{!~ Replace all occurances of OldSubString with NewSubString in SourceString}
Function String_Replace(
  OldSubString : String;
  NewSubString : String;
  SourceString : String): String;

{!~ Replace all occurances of OldSubString with NewSubString in SourceString ignoring case}
Function String_Replace_NoCase(
  OldSubString : String;
  NewSubString : String;
  SourceString : String): String;

{!~ Returns a string whose values are all reversed,i.e. , the
first character is last and the last is first.}
Function String_Reverse(S : String): String;

{!~ Returns a SubString of a String.
Can only handle strings up to 255 characters.}
Function SubStr(InputString: String; StartPos, StringLength: Byte): String;

{!~ Subtracts the records in the source
 table from the destination table}
Function SubtractTable(
           const
           SourceDatabaseName,
           SourceTable,
           DestDatabaseName,
           DestinationTable: string): Boolean;

{!~ Add source table to destination table}
Function TableAdd(
           const
           SourceDatabaseName,
           SourceTable,
           DestDatabaseName,
           DestinationTable: string): Boolean;

{!~ Creates a new table from a Query.
 Complex joins can be output to a new table.}
Function TableCreateFromQuery(
            Query: TQuery;
            NewTableName,
            TableDatabaseName: String): Boolean;

{!~ Moves SourceTable From SourceDatabaseName
 To DestDatabasename.  If a table exists
 with the same name at DestDatabaseName it
 is overwritten.}
Function TableMove(
            SourceTable,
            SourceDatabaseName,
            DestDatabaseName: String): Boolean;

{!~ Subtracts the records in the source
 table from the destination table}
Function TableSubtract(
           const
           SourceDatabaseName,
           SourceTable,
           DestDatabaseName,
           DestinationTable: string): Boolean;

{Returns a time delta in minutes}
Function TimeDeltaInMinutes(
           StartDate : TDateTime;
           EndDate   : TDateTime): Double;

{Returns a time delta in seconds}
Function TimeDeltaInSeconds(
           StartDate : TDateTime;
           EndDate   : TDateTime): Double;

{Returns a time delta in Milliseconds}
Function TimeDeltaInMSeconds(
           StartDate : TDateTime;
           EndDate   : TDateTime): Double;

{!~ Returns Today's Date As A String}
Function Today: String;

{!~ Turns the panel upon which a TSpeedButton is placed
invisible if the SpeedButton's glyph is empty}
Procedure ToolBarButtonVisibleOne(P:TPanel;B : TSpeedButton);

{!~ Trims blank spaces from both sides of the string}
Function TrimBlanksFromEnds(InputString: String): String;

{!~ Trims blank spaces from the left of the string}
Function TrimBlanksLeft(InputString: String): String;

{!~ Trims blank spaces from the right of the string}
Function TrimBlanksRight(InputString: String): String;

{!~ Returns the database field type as a string.  If there
is an error, the table doesn't exist, the field doesn't
exist or some other reason a null string is returned.}
Function TypeField(DatabaseName, TableName, FieldName: String): String;

{!~ Returns the database field type as a string.  If there
is an error a null string is returned.}
Function TypeFieldFromDataSet(DataSet: TDataSet; FieldName: String): String;

{!~ Converts String To UpperCase}
Function Upper(InputString: String): String;

{!~ Returns the Windows User ID.}
Function UserIDFromWindows: string;

{!~ Populates a listbox with the executable's version information}
Function VersionInformation(
  ListBox : TListBox): Boolean;

{!~ Executes An External Executable}
Function WinExecute(ApToExec: String): THandle;

{!~ Executes An External Executable}
Function WinExecute32(
  FileName   : String;
  Visibility : integer):integer;

Implementation

Type
  TPanel_Cmp_Sec_ads = class(TPanel)
  Public
    procedure ResizeShadowLabel(Sender: TObject);
  End;

procedure TPanel_Cmp_Sec_ads.ResizeShadowLabel(
  Sender     : TObject);
Var
  PH, PW : Integer;
  LH, LW : Integer;
begin
  PH := TPanel(Sender).Height;
  PW := TPanel(Sender).Width;
  LH := TLabel(Controls[0]).Height;
  LW := TLabel(Controls[0]).Width;
  TLabel(Controls[0]).Top  := ((PH-LH) div 2)-3;
  TLabel(Controls[0]).Left := ((Pw-L
Öğrenmek ve öğretmek, akıntıya karşı yüzmek gibidir ilerleyemediğiniz taktirde gerilersiniz.
Cevapla