Utilities Object Methods

Applies to TestComplete 15.10, last modified on December 15, 2021

The Utilities object contains the following methods:

Method List

Name Description
AdjustLineBreaks Replaces all single carriage return (CR) or linefeed (LF) symbols in the specified string with the carriage return and linefeed pair (CR/LF).
AnsiCompareFileName Compares two file names under control of the current locale.
AnsiCompareStr Compares two strings under control of the current locale.
AnsiCompareText Compares two strings under control of the current locale.
AnsiExtractQuotedStr Converts a quoted string into an unquoted string.
AnsiLastChar Returns the last character in the string.
AnsiLowerCase Converts all the letters of the given string to lowercase.
AnsiLowerCaseFileName Converts all the letters of the given file name to lowercase.
AnsiQuotedStr Encloses the specified string in the specified characters.
AnsiSameStr Compares two specified strings.
AnsiSameText Compares two specified strings.
AnsiStrRScan Searches for the specified character in the specified string.
AnsiStrScan Searches for the specified character in the specified string.
AnsiUpperCase Converts all the letters of the given string to uppercase.
AnsiUpperCaseFileName Converts all the letters of the given string to uppercase.
Beep Generates an informing beep.
ChangeFileExt Changes the extension of the specified file.
CompareStr Compares two specified strings.
CompareText Compares two specified strings.
CreateDir Creates a new folder.
CurrToStr Converts the specified currency value to its string representation.
CurrToStrF Converts the given currency value to its string representation.
Date Returns the current date set on your computer.
DateTimeToFileDate Converts a variant value that stores date and time to an integer value.
DateTimeToStr Converts the variant value that stores date and time to a string.
DateTimeToString Converts a Variant value storing date and time to a string using the format string specified by the Format parameter.
DateTimeToSystemTime Converts a Variant value, which holds date and time, to a TSystemTime value.
DateToStr Converts a Variant value holding a date to a string.
DayOfWeek Returns the day of the week for the specified date.
DecodeDate Splits the specified date value into the year, month and day of the month.
DecodeTime Extracts hours, minutes, seconds and milliseconds from the specified time.
DeleteFile Deletes a file from the disk.
DirectoryExists Checks if the specified directory exists.
EncodeDate Converts the date specified by year, month and day to a Variant value.
EncodeTime Converts a time specified by hour, minute, second and millisecond to a Variant value.
ExcludeTrailingBackslash Removes the trailing path delimiter ('\') from the specified path.
ExpandFileName Converts the given relative file name into a fully qualified path name.
ExpandUNCFileName Converts the given relative file name into a fully qualified path name.
ExtractFileDir Extracts the drive and directory parts from the specified file name.
ExtractFileDrive Extracts the drive part from the specified file name.
ExtractFileExt Extracts the extension from the specified file name.
ExtractFileName Extracts the name and extension parts from the specified file name.
ExtractFilePath Extracts the drive and directory parts from the specified file name.
ExtractRelativePath Converts a fully qualified path name into a relative path name.
ExtractShortPathName Converts the specified file name to the short 8.3 form.
FileAge Returns the date and time assigned to the file with the specified name.
FileClose Closes the specified file.
FileCreate Creates a new file with the specified name and path.
FileDateToDateTime Converts an integer value that stores the timestamp of a file to a Variant value storing the date and time.
FileExists Obtains whether the specified file exists.
FileGetAttr Returns attributes of the specified file.
FileGetDate Returns the OS timestamp of the specified file.
FileOpen Opens the specified file.
FileRead Reads the specified number of bytes from the specified file.
FileSearch Searches for the specified file.
FileSeek Sets the file pointer to the specified position within a file.
FileSetAttr Sets the attributes of the specified file.
FileSetDate Sets the date and time attributes for the specified file.
FileWrite Writes the specified number of bytes to a file.
FindClose Closes the specified file.
FindFirst Finds the first instance of the file with the specified name, path and attributes.
FindNext Continues the search initiated by the FindFirst function.
FloatToStr Converts a floating-point value to a string.
FloatToStrF Converts a floating-point value to a string.
ForceDirectories Creates a new folder.
Format Converts the items of the given array to a string using the specified format.
FormatCurr Converts the given currency value to a string using the specified format.
FormatDateTime Converts the given DateTime value to a string using the specified format.
FormatFloat Converts a floating-point value to a string using the specified format.
GetCurrentDir Returns the fully qualified name of the current directory.
GetFormatSettings Resets all of the date and number format variables.
IncludeTrailingBackslash Ensures that the specified path ends with the trailing path delimiter.
IncMonth Increments the given Date value by the specified number of months.
IntToHex Converts the given number into a string that contains the number’s hexadecimal (base 16) representation.
IntToStr Converts the given number into a string.
IsDelimiter Indicates whether the specified character in the given string is one of the delimiters in the string Delimiters.
IsLeapYear Determines whether the given year is a leap year.
IsPathDelimiter Indicates whether the specified character in the given string is a path delimiter.
IsValidIdent Indicates whether the specified string is a valid JScript, C++Script, C#Script or DelphiScript identifier.
LastDelimiter Locates the last delimiter in the specified string.
LowerCase Converts all the letters of the given string to lowercase.
Now Returns the current date and time.
QuotedStr Encloses the specified string in quotes.
RemoveDir Removes the specified directory.
RenameFile Renames the specified file or folder.
ReplaceDate Changes the date part in the DateTime parameter.
ReplaceTime Changes the time part in the DateTime parameter.
SameText Determines whether the specified strings are equal.
SetCurrentDir Sets the specified directory as the current directory.
StringReplace Replaces occurrences of the specified substring in the given string.
StrLCat Adds the given string to the end of another string and cuts the resulting string, if necessary.
StrLComp Compares up to a specified maximum number of characters in two strings.
StrLIComp Compares up to a specified number of characters in the given strings.
StrToCurr Converts the string that represents a floating-point value to the corresponding Currency value.
StrToDate Converts the specified string to a value that encodes date.
StrToDateTime Converts the specified string to a value that encodes date and time.
StrToFloat Converts the specified string to a floating-point value.
StrToInt Converts the specified string to an integer value.
StrToIntDef Converts the specified string to an integer value.
StrToTime Converts the specified string to a Variant value that encodes time.
SysErrorMessage Converts the specified OS error code into the corresponding error message string.
SystemTimeToDateTime Converts a TSystemTime value to a Variant value that encodes date and time.
Time Returns the current time as a Variant value.
TimeToStr
Trim Removes the leading and trailing spaces as well as control characters from the specified string.
TrimLeft Removes the leading spaces and control characters from the specified string.
TrimRight Removes the trailing spaces and control characters from the specified string.
TSearchRec Creates a TSearchRec object and returns it.
UpperCase Converts all the letters of the given string to uppercase.
Win32Check Checks a Windows API call’s return value and raises an appropriate exception when this call fails.
WrapText Splits the specified string into multiple lines if its length reaches the given value or if there are occurrences of any of the specified characters.

See Also

Utilities Object

Highlight search results