//
{Copyright(c)2000 Advanced Delphi Systems
Richard Maley
Advanced Delphi Systems
12613 Maidens Bower Drive
Potomac, MD 20854 USA
phone 301-840-1554
maley@advdelphisys.com
The code herein can be used or modified by anyone. Please retain references
to Richard Maley at Advanced Delphi Systems. If you make improvements to the
code please send your improvements to maley@advdelphisys.com so that the
entire Delphi community can benefit. All comments are welcome.
Please note if you are viewing this Delphi unit as a web page all you have to
do to turn it into a Delphi unit is save it with a ".pas" extension. The
html in the unit should not affect its performance.
}
Unit Cmp_Sec;
(*UnitIndex Master Index Implementation Section Download UnitsDescription: Cmp_Sec.pas This unit contains the following routines.
AboutBox_ads AddTables AppClose AppExecute AppHandle AppIsRunning AppLoad AppSwitchTo AppTerminate ButtonReSizer CD CenterChild CenterChildren_H CenterComponent CenterForm CenterFormHorizontally CenterFormVertically CompDimensions ConvertIntegerToBinaryString ConvertPCharToString ConvertStringToChar ConvertStringToInteger ConvertStringToPChar ConvertWordToBinaryString CopyDirectory CopyFile CopyFiles CreateTableFromQuery Date_DaysInMonth Date_FirstDayOfLastWeek Date_FirstDayOfNextMonth Date_FirstDayOfNextWeek Date_FirstDayOfWeek Date_LastDayOfMonth Date_Month Date_MonthNext Date_MonthPrior Date_MoveNDays Date_NextDay Date_NextWeek Date_PriorDay Date_PriorWeek DBAddQueryToTable DBAddTables DBCopyFieldAToB DBCopyTable DBCopyTableAToB DBCopyTableToServer DBCreateTableBorrowStr DBCreateTableFromQuery DBDeleteTable DBDropTable DBEmptyTable DBFieldNameByNo DBFieldNamesCommonToString DBFieldNamesCommonToTStrings DBFieldNamesToTStrings DBFieldNo DBFieldSize DBFieldType DBFieldTypeByNo DBGlobalStringFieldChange DBGlobalStringFieldChangeWhere DBGlobalStringFieldChangeWhere2 DBInsertMatchingFields DBKeyFieldNamesToTStrings DBLookUpDialog DBMedianSingle DBMoveTable DBNextAlphaKey DBNextInteger DBNFields DBParadoxCreateNKeys DBRecordMove DBReNameTable DBSchemaSame DBSessionCreateNew DBSqlValueQuoted DBSubtractTable DBTrimBlanksLeft DBTrimBlanksRight DBUpdateMatchingFields DeleteCharacterInString DeleteFiles DeleteLineBreaks DeleteSubStringInString DeleteSubStringInStringNoCase DeleteTable DelphiCheck DelphiChecker DelphiIsRunning DelTree DialogAboutBox_ads DialogDBLookUp DialogInputBoxOnlyAToZ DialogInputBoxOnlyNumbers DialogInputBoxOnlyNumbersAbsolute DialogLookup DialogLookupDetail Directory DirectoryCopy DirectoryHide DirectoryMove DirectoryUnHide DropTable EmptyDirectory EmptyTable ErrorMeaning ExcelAddWorkSheet ExcelClose ExcelCloseWorkBooks ExcelColIntToStr ExcelColStrToInt ExcelCopyToStringGrid ExcelDeleteWorkSheet ExcelEnd ExcelFind ExcelFindInRange ExcelFindValue ExcelFirstCol ExcelFirstRow ExcelGetActiveSheetName ExcelGetCellFormula ExcelGetCellValue ExcelGetCol ExcelGetRow ExcelGoToLastCol ExcelGoToLastRow ExcelGoToLeftmostCol ExcelGoToTopRow ExcelHome ExcelLastCol ExcelLastRow ExcelOpenFile ExcelOpenFileComplex ExcelPasteValuesOnly ExcelRenameSheet ExcelSaveAsDBase4 ExcelSaveAsText ExcelSelectBlock ExcelSelectBlockWhole ExcelSelectCell ExcelSelectRange ExcelSelectSheetByName ExcelSetCellFormula ExcelSetCellValue ExcelSetColumnWidth ExcelSetVisible ExcelValuesOnly ExcelVersion ExecutableUpdate ExecuteExe ExecuteExeParams ExecuteKnownFileType ExtractFileExtNoPeriod ExtractFileNameNoExt FieldNo FieldSize FieldType FieldTypeFromDataSet File_CopyDirectory File_DeleteDirectory File_DelTree File_DirOperations_Datail File_DirOperations_Detail File_GetCreationDate File_GetLastAccessDate File_GetLastModifiedDate File_GetLongFileName File_GetShortFileName File_KillDirectory File_MoveDirectory File_RemoveDirectory File_ReNameDirectory FileDate FileDatesSame FileExt FileMove FileName FileNextNumberName FileNotTextSize FilePath FilesInDirDetail FormCenterHorizontal FormCenterVertical FormDimensions GetCenterFormLeft GetCenterFormTop GridDeleteRow GridMoveRowToBottom ImageFadeAway ImageFadeIn ImageFadeInAndOut ImageFadeInAndOutDetail ImageFlipHoriz ImageFlipVert ImageFlutterHoriz ImageFlutterHorizDetail ImageFlutterVert ImageFlutterVertDetail ImagePulsate ImageRotateDetail IniGetIntegerValue IniGetStringValue IniSetIntegerValue IniSetStringValue IniUpdateFromTStringList IniUpdateTStringList InputBoxFilterDetail InputBoxOnlyAToZ InputBoxOnlyNumbers InputBoxOnlyNumbersAbsolute Internet_EmptyCacheDirectories Internet_GetURLsFromCachePages InternetCopyURLToFile InternetGetBaseURL InternetIsUrl IsBlockColSide IsBlockRowSide IsDate IsDelphiRunning IsDir IsDirEmpty IsEmptyDataSource IsEmptyTable IsEmptyTable2 IsEmptyTQuery IsEmptyTTable IsField IsFieldKeyed IsFile IsRecord IsSchemaSame IsStructureSame IsTable IsTableKeyed KeyPressOnlyAToZ KeyPressOnlyLettersAbsolute KeyPressOnlyNumbers KeyPressOnlyNumbersAbsolute KeySend KillDirectory Len LettersOnlyAbsolute LookupDialog Lower Max MD Min Min_I MoveDirectory MoveTable Msg MsgDlg NFields NMHttp_GetURLToFile NMHttp_IsUrl NMHttp_PostURLToFile NumbersOnly NumbersOnlyAbsolute NumVal PanelBevel Pi_Real ProgressScreenCursor Proper PurgeInternetCache Rand RandImage RandomInteger RD ReNameDir ReNameDirectory ReplaceCharacterInString ReplaceCharInString ReplaceSubStringInString ReplaceSubStringInStringNoCase ReSizeTuner ScaleForm SendKey SetChildWidths SetFileDate String_Grep_Contents String_Grep_Detail String_GrepAllToStringList String_LineFeed_Format String_LineFeed_Insert String_Replace String_Replace_NoCase String_Reverse StringPad SubStr SubtractTable TableAdd TableCreateFromQuery TableMove TableSubtract TimeDeltaInMinutes TimeDeltaInMSeconds TimeDeltaInSeconds Today ToolBarButtonVisibleOne TrimBlanksFromEnds TrimBlanksLeft TrimBlanksRight TypeField TypeFieldFromDataSet Upper UserIDFromWindows VersionInformation WinExecute WinExecute32
*)
Interface
Uses
SysUtils, StdCtrls, Dialogs, Forms, ExtCtrls,
Messages, WinProcs, WinTypes, Buttons, Classes,
DB, DBTables, Controls, Grids, IniFiles, Graphics,
ShellAPI, FileCtrl,
wininet,
NMHTTP
{$IFNDEF WIN32}, ToolHelp{$ENDIF};
{!~ 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 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 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 Unit Description UnitIndex Master Index
Procedure AboutBox_ads(
AboutTitle : String;
AboutWidth : Integer;
AboutHeight : Integer
);
Begin
ads_comp.AboutBox_ads(AboutTitle,AboutWidth,AboutHeight);
End;
//
Unit Description UnitIndex Master Index
Function AddTables(
const
SourceDatabaseName,
SourceTable,
DestDatabaseName,
DestinationTable: string): Boolean;
Begin
Result := Ads_DB.AddTables(SourceDatabaseName,SourceTable,DestDatabaseName,DestinationTable);
End;
//
Unit Description UnitIndex Master Index
procedure AppClose(ExecutableName,WinClassName : String);
Begin
ads_file.
AppClose(ExecutableName,WinClassName);
End;
//Unit Description UnitIndex Master Index
procedure AppExecute(
ExecutableName : String;
WinClassName : String);
Begin
ads_file.
AppExecute(
ExecutableName,
WinClassName);
End;
//Unit Description UnitIndex Master Index
function AppHandle(WinClassName : String): THandle;
Begin
Result :=
ads_file.
AppHandle(WinClassName);
End;
//Unit Description UnitIndex Master Index
Function AppIsRunning(AppName: String): Boolean;
Begin
Result :=
ads_file.
AppIsRunning(AppName);
End;
//Unit Description UnitIndex Master Index
Function AppLoad(const ExecutableName: string; show : word) : THandle;
Begin
Result := ads_file.AppLoad(ExecutableName, show);
End;
//
Unit Description UnitIndex Master Index
function AppSwitchTo(WinClassName : String): boolean;
Begin
Result := ads_file.AppSwitchTo(WinClassName);
End;
//
Unit Description UnitIndex Master Index
Function AppTerminate(AppName: String): Boolean;
Begin
Result := ads_file.AppTerminate(AppName);
End;
//
Unit Description UnitIndex Master Index
procedure ButtonReSizer(
ButtonBase : TPanel;
ButtonSlider : TPanel;
ButtonWidth : Integer;
ButtonSpacer : Integer;
ButtonsReSize : Boolean;
ButtonsAlignment: TAlignment;
Beveled : Boolean);
Begin
ads_comp.
ButtonReSizer(
ButtonBase,
ButtonSlider,
ButtonWidth,
ButtonSpacer,
ButtonsReSize,
ButtonsAlignment,
Beveled);
End;
//Unit Description UnitIndex Master Index
Function CD(DirName: String): Boolean;
Begin
Result :=
ads_file.
CD(DirName);
End;
//Unit Description UnitIndex Master Index
procedure CenterChild(Panel : TPanel);
Begin
ads_comp.
CenterChild(Panel);
End;
//Unit Description UnitIndex Master Index
procedure CenterChildren_H(Panel : TPanel);
Begin
ads_comp.
CenterChildren_H(Panel);
End;
//Unit Description UnitIndex Master Index
Procedure CenterComponent(ParentControl, ChildControl: TControl);
Begin
ads_comp.
CenterComponent(ParentControl, ChildControl);
End;
//Unit Description UnitIndex Master Index
Procedure CenterForm(f : TForm);
Begin
ads_comp.
CenterForm(f);
End;
//Unit Description UnitIndex Master Index
Procedure CenterFormHorizontally(f : TForm);
Begin
ads_comp.
CenterFormHorizontally(f);
End;
//Unit Description UnitIndex Master Index
Procedure CenterFormVertically(f : TForm);
Begin
ads_comp.
CenterFormVertically(f);
End;
//Unit Description UnitIndex Master Index
procedure CompDimensions(
Comp: TControl;
TopDim,
LeftDim,
HeightDim,
WidthDim: Integer);
Begin
ads_comp.
CompDimensions(
Comp,
TopDim,
LeftDim,
HeightDim,
WidthDim);
End;
//Unit Description UnitIndex Master Index
Function ConvertIntegerToBinaryString(Int, Length : Integer) : ShortString;
Begin
Result :=
Ads_Conv.
ConvertIntegerToBinaryString(Int, Length);
End;
//Unit Description UnitIndex Master Index
Function ConvertPCharToString(PCharValue: PChar): String;
Begin
Result :=
Ads_Conv.
ConvertPCharToString(PCharValue);
End;
//Unit Description UnitIndex Master Index
Function ConvertStringToChar(InputString: String; CharPosition: Integer): Char;
Begin
Result :=
Ads_Conv.
ConvertStringToChar(InputString, CharPosition);
End;
//Unit Description UnitIndex Master Index
Function ConvertStringToInteger(StringValue: String): Integer;
Begin
Result :=
Ads_Conv.
ConvertStringToInteger(StringValue);
End;
//Unit Description UnitIndex Master Index
Function ConvertStringToPChar(StringValue: String): PChar;
Begin
Result :=
Ads_Conv.
ConvertStringToPChar(StringValue);
End;
//Unit Description UnitIndex Master Index
Function ConvertWordToBinaryString(InputWord : Word; Length : Integer) : ShortString;
Begin
Result :=
Ads_Conv.
ConvertWordToBinaryString(InputWord, Length);
End;
//Unit Description UnitIndex Master Index
Function CopyDirectory(
SourceDirectoryName: String;
DestDirectoryName: String): Boolean;
Begin
Result := ads_file.CopyDirectory(SourceDirectoryName,DestDirectoryName);
End;
//
Unit Description UnitIndex Master Index
Function CopyFile(FromFile,ToFile:String): Boolean;
Begin
Result :=
ads_file.
CopyFile(FromFile,ToFile);
End;
//Unit Description UnitIndex Master Index
Function CopyFiles(FromPath,ToPath,FileMask: String): Boolean;
Begin
Result :=
ads_file.
CopyFiles(FromPath,ToPath,FileMask);
End;
//Unit Description UnitIndex Master Index
Function CreateTableFromQuery(
Query: TQuery;
NewTableName,
TableDatabaseName: String): Boolean;
Begin
Result :=
Ads_DB.
CreateTableFromQuery(
Query,
NewTableName,
TableDatabaseName);
End;
//Unit Description UnitIndex Master Index
Procedure DBAddQueryToTable(
DataSet : TQuery;
const
DestDatabaseName,
DestinationTable: string);
Begin
Ads_DB.DBAddQueryToTable(DataSet,DestDatabaseName,DestinationTable);
End;
//
Unit Description UnitIndex Master Index
Function DBAddTables(
const
SourceDatabaseName,
SourceTable,
DestDatabaseName,
DestinationTable: string): Boolean;
Begin
Result := Ads_DB.DBAddTables(SourceDatabaseName,SourceTable,DestDatabaseName,DestinationTable);
End;
//
Unit Description UnitIndex Master Index
function DBCopyFieldAToB(
DatabaseName,
TableName,
SourceField,
DestField: String): Boolean;
Begin
Result := Ads_DB.DBCopyFieldAToB(DatabaseName,TableName,SourceField,DestField);
End;
//
Unit Description UnitIndex Master Index
Function DBCopyTable(
SourceDatabaseName,
SourceTable,
DestDatabaseName,
DestTable: String): Boolean;
Begin
Result :=
Ads_DB.
DBCopyTable(
SourceDatabaseName,
SourceTable,
DestDatabaseName,
DestTable);
End;
//Unit Description UnitIndex Master Index
Function DBCopyTableAToB(
SourceDatabaseName,
SourceTable,
DestDatabaseName,
DestTable: String): Boolean;
Begin
Result :=
Ads_DB.
DBCopyTableAToB(
SourceDatabaseName,
SourceTable,
DestDatabaseName,
DestTable);
End;
//Unit Description UnitIndex Master Index
Function DBCopyTableToServer(
SourceDatabaseName : String;
SourceTableName : String;
DestDatabaseName : String;
DestTableName : String): Boolean;
Begin
Result :=
Ads_DB.
DBCopyTableToServer(
SourceDatabaseName,
SourceTableName,
DestDatabaseName,
DestTableName);
End;
//Unit Description UnitIndex Master Index
Function DBCreateTableBorrowStr(
SourceDatabaseName : String;
SourceTableName : String;
DestDatabaseName : String;
DestTableName : String): Boolean;
Begin
Result :=
Ads_DB.
DBCreateTableBorrowStr(
SourceDatabaseName,
SourceTableName,
DestDatabaseName,
DestTableName);
End;
//Unit Description UnitIndex Master Index
Function DBCreateTableFromQuery(
Query: TQuery;
NewTableName,
TableDatabaseName: String): Boolean;
Begin
Result :=
Ads_DB.
DBCreateTableFromQuery(
Query,
NewTableName,
TableDatabaseName);
End;
//Unit Description UnitIndex Master Index
Function DBDeleteTable(const DatabaseName, TableName : string):Boolean;
Begin
Result := Ads_DB.DBDeleteTable(DatabaseName, TableName);
End;
//
Unit Description UnitIndex Master Index
Function DBDropTable(const DatabaseName, TableName : string):Boolean;
Begin
Result := Ads_DB.DBDropTable(DatabaseName, TableName);
End;
//
Unit Description UnitIndex Master Index
Function DBEmptyTable(
const DatabaseName,
TableName : string): Boolean;
Begin
Result := Ads_DB.DBEmptyTable(DatabaseName, TableName);
End;
//
Unit Description UnitIndex Master Index
Function DBFieldNameByNo(
DatabaseName : String;
TableName : String;
FieldNo : Integer): String;
Begin
Result :=
Ads_DB.
DBFieldNameByNo(
DatabaseName,
TableName,
FieldNo);
End;
//Unit Description UnitIndex Master Index
Function DBFieldNamesCommonToString(
DatabaseName1 : String;
TableName1 : String;
DatabaseName2 : String;
TableName2 : String): String;
Begin
Result :=
Ads_DB.
DBFieldNamesCommonToString(
DatabaseName1,
TableName1,
DatabaseName2,
TableName2);
End;
//Unit Description UnitIndex Master Index
Function DBFieldNamesCommonToTStrings(
DatabaseName1 : String;
TableName1 : String;
DatabaseName2 : String;
TableName2 : String;
Strings : TStrings): Boolean;
Begin
Result :=
Ads_DB.
DBFieldNamesCommonToTStrings(
DatabaseName1,
TableName1,
DatabaseName2,
TableName2,
Strings);
End;
//Unit Description UnitIndex Master Index
Function DBFieldNamesToTStrings(
DatabaseName : String;
TableName : String;
Strings : TStrings): Boolean;
Begin
Result :=
Ads_DB.
DBFieldNamesToTStrings(
DatabaseName,
TableName,
Strings);
End;
//Unit Description UnitIndex Master Index
Function DBFieldNo(DatabaseName, TableName, FieldName: String): Integer;
Begin
Result :=
Ads_DB.
DBFieldNo(DatabaseName, TableName, FieldName);
End;
//Unit Description UnitIndex Master Index
Function DBFieldSize(DatabaseName, TableName, FieldName: String): Integer;
Begin
Result :=
Ads_DB.
DBFieldSize(DatabaseName, TableName, FieldName);
End;
//Unit Description UnitIndex Master Index
Function DBFieldType(DatabaseName, TableName, FieldName: String): String;
Begin
Result :=
Ads_DB.
DBFieldType(DatabaseName, TableName, FieldName);
End;
//Unit Description UnitIndex Master Index
Function DBFieldTypeByNo(DatabaseName, TableName: String; FieldNo: Integer): String;
Begin
Result := Ads_DB.DBFieldTypeByNo(DatabaseName, TableName, FieldNo);
End;
//
Unit Description UnitIndex Master Index
procedure DBGlobalStringFieldChange(
const DatabaseName,
TableName,
FieldName,
NewValue : string);
Begin
Ads_DB.DBGlobalStringFieldChange(DatabaseName,TableName,FieldName,NewValue);
End;
//
Unit Description UnitIndex Master Index
procedure DBGlobalStringFieldChangeWhere(
const DatabaseName,
TableName,
FieldName,
CurrentValue,
NewValue : string);
Begin
Ads_DB.DBGlobalStringFieldChangeWhere(DatabaseName,TableName,FieldName,CurrentValue,NewValue);
End;
//
Unit Description UnitIndex Master Index
procedure DBGlobalStringFieldChangeWhere2(
const DatabaseName,
TableName,
NewValueField,
NewValue,
CurrentValueField,
CurrentValue: string);
Begin
Ads_DB.DBGlobalStringFieldChangeWhere2(DatabaseName,TableName,NewValueField,NewValue,CurrentValueField,CurrentValue);
End;
//
Unit Description UnitIndex Master Index
Function DBInsertMatchingFields(
const
SourceDatabaseName,
SourceTable,
DestDatabaseName,
DestinationTable,
ErrorField: string): Boolean;
Begin
Result := Ads_DB.DBInsertMatchingFields(SourceDatabaseName,SourceTable,DestDatabaseName,DestinationTable,ErrorField);
End;
//
Unit Description UnitIndex Master Index
Function DBKeyFieldNamesToTStrings(
DatabaseName : String;
TableName : String;
Strings : TStrings): Boolean;
Begin
Result :=
Ads_DB.
DBKeyFieldNamesToTStrings(
DatabaseName,
TableName,
Strings);
End;
//Unit Description UnitIndex Master Index
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;
Begin
Result :=
Ads_DB.
DBLookUpDialog(
DataBaseName,
TableName,
FieldName,
SessionName,
DefaultValue,
DialogCaption,
InputPrompt,
DialogWidth
);
End;
//Unit Description UnitIndex Master Index
Function DBMedianSingle(
const DatabaseName,
TableName,
FieldName,
WhereString
: string): Single;
Begin
Result :=
Ads_DB.
DBMedianSingle(
DatabaseName,
TableName,
FieldName,
WhereString
);
End;
//Unit Description UnitIndex Master Index
Function DBMoveTable(
SourceTable,
SourceDatabaseName,
DestDatabaseName: String): Boolean;
Begin
Result :=
Ads_DB.
DBMoveTable(
SourceTable,
SourceDatabaseName,
DestDatabaseName);
End;
//Unit Description UnitIndex Master Index
Function DBNFields(DatabaseName, TableName: String): Integer;
Begin
Result :=
Ads_DB.
DBNFields(DatabaseName, TableName);
End;
//Unit Description UnitIndex Master Index
Function DBNextAlphaKey(DatabaseName, TableName, FieldName: String):String;
Begin
Result :=
Ads_DB.
DBNextAlphaKey(DatabaseName, TableName, FieldName);
End;
//Unit Description UnitIndex Master Index
Function DBNextInteger(
DatabaseName,
TableName,
FieldName: String):LongInt;
Begin
Result :=
Ads_DB.
DBNextInteger(
DatabaseName,
TableName,
FieldName);
End;
//Unit Description UnitIndex Master Index
Function DBParadoxCreateNKeys(
DatabaseName : String;
TableName : String;
NKeys : Integer): Boolean;
Begin
Result :=
Ads_DB.
DBParadoxCreateNKeys(
DatabaseName,
TableName,
NKeys);
End;
//Unit Description UnitIndex Master Index
Function DBReNameTable(
DatabaseName,
TableNameOld,
TableNameNew: String): Boolean;
Begin
Result :=
Ads_DB.
DBReNameTable(
DatabaseName,
TableNameOld,
TableNameNew);
End;
//Unit Description UnitIndex Master Index
Function DBRecordMove(
SourceDatabaseName,
SourceTable,
DestDatabaseName,
DestTable: String;
BMode: TBatchMode): Boolean;
Begin
Result :=
Ads_DB.
DBRecordMove(
SourceDatabaseName,
SourceTable,
DestDatabaseName,
DestTable,
BMode);
End;
//Unit Description UnitIndex Master Index
Function DBSchemaSame(const
DatabaseName1,
Table1,
DatabaseName2,
Table2: string): Boolean;
Begin
Result :=
Ads_DB.
DBSchemaSame(
DatabaseName1,
Table1,
DatabaseName2,
Table2);
End;
{$IFDEF WIN32}
//Unit Description UnitIndex Master Index
Function DBSessionCreateNew: TSession;
{$ENDIF WIN32}
Begin
Result :=
Ads_DB.
{$IFDEF WIN32}
DBSessionCreateNew;
{$ENDIF WIN32}
End;
//Unit Description UnitIndex Master Index
Function DBSqlValueQuoted(
const
DatabaseName,
TableName,
FieldName,
FieldValue: string): String;
Begin
Result :=
Ads_DB.
DBSqlValueQuoted(
DatabaseName,
TableName,
FieldName,
FieldValue);
End;
//Unit Description UnitIndex Master Index
Function DBSubtractTable(
const
SourceDatabaseName,
SourceTable,
DestDatabaseName,
DestinationTable: string): Boolean;
Begin
Result :=
Ads_DB.
DBSubtractTable(
SourceDatabaseName,
SourceTable,
DestDatabaseName,
DestinationTable);
End;
//Unit Description UnitIndex Master Index
Function DBTrimBlanksLeft(
DatabaseName : String;
TableName : String;
FieldName : String): Boolean;
Begin
Result :=
Ads_DB.
DBTrimBlanksLeft(
DatabaseName,
TableName,
FieldName);
End;
//Unit Description UnitIndex Master Index
Function DBTrimBlanksRight(
DatabaseName : String;
TableName : String;
FieldName : String): Boolean;
Begin
Result :=
Ads_DB.
DBTrimBlanksRight(
DatabaseName,
TableName,
FieldName);
End;
//Unit Description UnitIndex Master Index
Function DBUpdateMatchingFields(
const
SourceDatabaseName,
SourceTable,
DestDatabaseName,
DestinationTable,
ErrorField: string;
MsgPanel: TPanel;
FilePath: String): Boolean;
Begin
Result :=
Ads_DB.
DBUpdateMatchingFields(
SourceDatabaseName,
SourceTable,
DestDatabaseName,
DestinationTable,
ErrorField,
MsgPanel,
FilePath);
End;
//Unit Description UnitIndex Master Index
Function Date_DaysInMonth(DateValue: TDateTime): Integer;
Begin
Result :=
ads_date.
Date_DaysInMonth(DateValue);
End;
//Unit Description UnitIndex Master Index
Function Date_FirstDayOfLastWeek(DateValue: TDateTime): TDateTime;
Begin
Result :=
ads_date.
Date_FirstDayOfLastWeek(DateValue);
End;
//Unit Description UnitIndex Master Index
Function Date_FirstDayOfNextMonth(DateValue: TDateTime): TDateTime;
Begin
Result :=
ads_date.
Date_FirstDayOfNextMonth(DateValue);
End;
//Unit Description UnitIndex Master Index
Function Date_FirstDayOfNextWeek(DateValue: TDateTime): TDateTime;
Begin
Result :=
ads_date.
Date_FirstDayOfNextWeek(DateValue);
End;
//Unit Description UnitIndex Master Index
Function Date_FirstDayOfWeek(DateValue: TDateTime): TDateTime;
Begin
Result :=
ads_date.
Date_FirstDayOfWeek(DateValue);
End;
//Unit Description UnitIndex Master Index
Function Date_LastDayOfMonth(DateValue: TDateTime): TDateTime;
Begin
Result :=
ads_date.
Date_LastDayOfMonth(DateValue);
End;
//Unit Description UnitIndex Master Index
Function Date_Month(DateValue: TDateTime): Integer;
Begin
Result :=
ads_date.
Date_Month(DateValue);
End;
//Unit Description UnitIndex Master Index
Function Date_MonthNext(DateValue: TDateTime): Integer;
Begin
Result :=
ads_date.
Date_MonthNext(DateValue);
End;
//Unit Description UnitIndex Master Index
Function Date_MonthPrior(DateValue: TDateTime): Integer;
Begin
Result :=
ads_date.
Date_MonthPrior(DateValue);
End;
//Unit Description UnitIndex Master Index
Function Date_MoveNDays(
DateValue : TDateTime;
DateMovement : Integer): TDateTime;
Begin
Result :=
ads_date.
Date_MoveNDays(
DateValue,
DateMovement);
End;
//Unit Description UnitIndex Master Index
Function Date_NextDay(DateValue: TDateTime): TDateTime;
Begin
Result :=
ads_date.
Date_NextDay(DateValue);
End;
//Unit Description UnitIndex Master Index
Function Date_PriorDay(DateValue: TDateTime): TDateTime;
Begin
Result :=
ads_date.
Date_PriorDay(DateValue);
End;
//Unit Description UnitIndex Master Index
Function Date_PriorWeek(DateValue: TDateTime): TDateTime;
Begin
Result :=
ads_date.
Date_PriorWeek(DateValue);
End;
//Unit Description UnitIndex Master Index
Function DelTree(DirectoryName: String): Boolean;
Begin
Result :=
ads_file.
DelTree(DirectoryName);
End;
//Unit Description UnitIndex Master Index
Function DeleteCharacterInString(InputCharacter,InputString: String): String;
Begin
Result :=
Ads_Strg.
DeleteCharacterInString(InputCharacter,InputString);
End;
//Unit Description UnitIndex Master Index
Function DeleteFiles(FilePath,FileMask: String): Boolean;
Begin
Result :=
ads_file.
DeleteFiles(FilePath,FileMask);
End;
//Unit Description UnitIndex Master Index
function DeleteLineBreaks(const S: string): string;
Begin
Result :=
Ads_Strg.
DeleteLineBreaks(S);
End;
//Unit Description UnitIndex Master Index
Function DeleteSubStringInString(substring,InputString: String): String;
Begin
Result :=
Ads_Strg.
DeleteSubStringInString(substring,InputString);
End;
//Unit Description UnitIndex Master Index
Function DeleteSubStringInStringNoCase(substring,InputString: String): String;
Begin
Result :=
Ads_Strg.
DeleteSubStringInStringNoCase(substring,InputString);
End;
//Unit Description UnitIndex Master Index
Function DeleteTable(const DatabaseName, TableName : string):Boolean;
Begin
Result :=
Ads_DB.
DeleteTable(DatabaseName, TableName);
End;
//Unit Description UnitIndex Master Index
procedure DelphiCheck(CanRunOutSide: Boolean);
Begin
Ads_Misc.
DelphiCheck(CanRunOutSide);
End;
//Unit Description UnitIndex Master Index
procedure DelphiChecker(
CanRunOutSide : Boolean;
ComponentName : String;
OwnerName : String;
PurchaseMessage : String;
ActivateDate : String);
Begin
Ads_Misc.
DelphiChecker(
CanRunOutSide,
ComponentName,
OwnerName,
PurchaseMessage,
ActivateDate);
End;
//Unit Description UnitIndex Master Index
Function DelphiIsRunning: Boolean;
Begin
Result := Ads_Misc.DelphiIsRunning;
End;
//
Unit Description UnitIndex Master Index
Procedure DialogAboutBox_ads(
AboutTitle : String;
AboutWidth : Integer;
AboutHeight : Integer
);
Begin
ads_comp.
DialogAboutBox_ads(
AboutTitle,
AboutWidth,
AboutHeight
);
End;
//Unit Description UnitIndex Master Index
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;
Begin
Result :=
Ads_DB.
DialogDBLookUp(
DataBaseName,
TableName,
FieldName,
SessionName,
DefaultValue,
DialogCaption,
InputPrompt,
DialogWidth
);
End;
//Unit Description UnitIndex Master Index
Function DialogInputBoxOnlyAToZ(
const DialogCaption : string;
const InputPrompt : string;
const DefaultValue : string): string;
Begin
Result :=
ads_comp.
DialogInputBoxOnlyAToZ(
DialogCaption,
InputPrompt,
DefaultValue);
End;
//Unit Description UnitIndex Master Inde