Common Delphi Functions

Source: Internet
Author: User
Tags control characters natural logarithm terminates

Handle exceptions caused by the Abort Function

Abs function absolute value function

The AddExitProc function adds a process to the End Process Table of the runtime database.

The Addr function returns the address of the specified object.

The AdjustLineBreaks function adjusts the row Separator of a given string to the CR/LF sequence.

The Align attribute allows the control to be located in a certain part of the window.

The text position of the label of the Alignment attribute Control

The AllocMem function allocates blocks of a given size on the stack.

The AllowGrayed attribute allows a grayscale selection.

The AnsiCompareStr function compares strings (case sensitive)

The AnsiCompareText function compares strings (Case Insensitive)

The AnsiLowerCase function converts characters to lowercase letters.

The AnsiUpperCase function converts characters to uppercase letters.

The Append function opens an existing file by appending it.

ArcTan function cotangent Function

The AssignFile function assigns an external file name to the file variable.

Whether the Assigned function test function or process variable is null

The AutoSize attribute automatically controls the label size.

BackgroundColor attribute background color

The BeginThread function establishes a thread for memory management in an appropriate way.

BevelInner attribute Control

BevelOuter attribute Control Box

BevelWidth attribute controls the width of the outer box of the box

The BlockRead function reads one or more records to the variable.

The BlockWrite function writes one or more records from the variable.

BorderStyle attribute boundary type

BorderWidth attribute boundary width

The Break command terminates the for, while, and repeat loop statements.

Brush attribute painter

Caption attribute label text content

The ChangeFileExt function changes the file suffix.

The ChDir function changes the current directory.

Checked attribute confirmation check box selection status

The Chr function returns the characters of the specified ordinal number.

CloseFile command to Close opened files

Color attribute label Color

Columns

CompareStr functions compare strings (case sensitive)

Concat functions merge strings

The Continue command continues the next loop of for, while, and repeat.

The Copy function returns a string of substrings.

Cos function cosine function

Whether the Ctl3D attribute has 3D effect

Cursor attribute: The shape after the mouse pointer is moved in

The Date function returns the current Date.

The DateTimeToFileDate function converts the DELPHI date format to the DOS date format.

The DateTimeToStr function converts the datetime format to a string.

The DateTimeToString function converts the datetime format to a string.

The DateToStr function converts the date format to a string.

The DayOfWeek function returns the value of the week.

Variable value of decimal Function

The DecodeDate function splits the date format into year, month, and day.

The DecodeTime function splits the time format into minutes, minutes, seconds, and milliseconds.

The Delete function deletes a substring from a string.

DeleteFile command to delete an object

The DiskFree function returns the size of the remaining disk space.

The DiskSize function returns the capacity of the specified disk.

The Dispose function releases the space occupied by dynamic variables.

The DisposeStr function releases the memory space of the string in the stack.

The DitherBackground attribute adds or reduces the background color by 50%.

DragCursor attribute when the mouse clicks the shape of the time mark

Method of pressing the DragMode attribute

The number of data items allowed by the DropDownCount attribute

EditMask attribute editing mode

Enabled attribute indicates whether to enable the label

The EncodeDate function combines year, month, and day into the date format.

The EncodeTime function combines time, minute, second, and millisecond into the time format.

EndMargin attribute end edge

The Eof function tests whether a file with or without a type is at the end of the file.

The Eoln function returns the row end status of the text file.

Erase command to delete external files

The deletaddr function returns the address that caused the current accident.

The Exclude function deletes some elements from the set.

The deletobject function returns the current unexpected index.

The Exit command exits from the current statement block immediately.

Exp function exponential function

The ExpandFileName function returns a string containing an absolute path.

Whether the ExtendedSelect attribute allows the existence of the selection mode. If it is set to True, MultiSelect makes sense.

The ExtractFileDir function returns the drive and path.

Extension of the file returned by the ExtractFileExt Function

The ExtractFileName function returns the file name.

The ExtractFilePath function returns the path of the specified file.

The FileAge function returns the time when the file already exists.

Run the FileClose command to close the specified file.

The FileCreate command creates a new file with the specified file name

The FileDateToDateTime function converts the DOS date format to the DELPHI date format.

The FileExists function checks whether the file exists.

The FileGatAttr function returns the attributes of a file.

The FileGetDate function returns the DOS date and time mark of the file.

The FileOpen command uses the specified access mode to open the specified file.

The FilePos function returns the current pointer position of the file.

The FileRead command reads data from a specified file.

The FileSearch command searches the directory for the specified file.

The FileSeek function changes the object pointer.

The FileSetAttr function sets file attributes.

The FileSetDate function sets the file's DOS date and time mark.

The FileSize function returns the size of the current file.

The FileWrite function writes the specified file.

The FillChar function fills the number of consecutive bytes with the specified value.

The FindClose command terminates the FindFirst/FindNext sequence.

The FindFirst command searches for directories for the specified file name and attributes.

The FindNext command returns the next entry that matches the file name and attribute.

The FloatToDecimal function converts a floating point number to a decimal number.

The FloatToStrF function converts a floating point number to a string.

The FloatToStr function converts a floating point number to a string.

The FloatToText function converts a given floating point number to a decimal number.

The FloatToTextFmt function converts a given floating point number to a decimal number.

The Flush function refreshes the buffer content to the output text file.

The FmtLoadStr function loads strings from the program's resource string table.

The FmtStr function is used to format a series of parameters. The Result is returned using the Result parameter.

Font attribute setting Font

The Format Function Format a series of parameters and returns the Pascal string.

FormatBuf functions format a series of parameters

The FormatDateTime function uses the specified format to format the date and time.

The FormatFloat function specifies the floating point format.

Fractional part of the parameter returned by the Frac Function

The FreeMem function releases the space occupied by dynamic variables based on the given size.

GetDir returns the current directory of the specified drive.

GetHeapStatus: returns the current status of the Memory Manager.

GetMem creates a dynamic variable of the specified size and points the pointer to this

GetMemoryManager returns the entry point of the Memory Manager.

Image on the Glyph function button

Halt stops program execution and returns to the Operating System

Hi, return the high address of the Parameter

The upper limit of the High response parameter.

Hint property prompt information

Int returns the integer part of the parameter.

Include add elements to the set

Insert a substring into a string

IntToHex converts an integer to a hexadecimal number.

IntToStr converts an integer to a string

IOResult returns the latest I/O operation completion status

IsValidIdent test whether the string is a valid identifier

Nodes Displayed by default for the Items attribute

Kind attribute placement Style

The maximum value of the LargeChange attribute.

Layout attribute Image Layout

The Length function returns the dynamic Length of a string.

Lines property default display content

Ln function natural logarithm function

The low address bit of the parameter returned by the Lo Function

The LoadStr function loads character resources from the executable files of an application.

The LowerCase function converts the given string to LowerCase.

The lower limit of the parameter returned by the Low Function

Max property maximum

Maximum length of the MaxLength attribute

Min attribute minimum value

Create a subdirectory using the mkdir command

The move function copies bytes from the source to the target.

The multiselect attribute allows you to select several data items at the same time.

Name of the control

The new function creates a new dynamic variable and sets a pointer

The newstr function allocates a new string on the stack.

The now function returns the current date and time.

Whether the odd test parameter is an odd number

Triggered when the onactivate Event Focus is moved to the form

Onclick event triggered by clicking the blank area of the form

The ondblclick event is triggered by double-clicking the blank area of the form.

Onclosequery event user tries to close form trigger

Triggered only when the onclose event form is closed

Triggered when the oncreate event form is created for the first time

The ondeactivate event is triggered when the user switches to another application.

Ondragdrop event triggered when the mouse-drag operation ends

The ondragover event is triggered by moving other controls from it.

Triggered when the onmousedown event is pressed

Triggered when the onmouseup event releases the mouse key

Triggered when the onmousemove event moves the mouse

Triggered when an onhide event hides a form

Triggered when an onkeydown event is pressed by a keyboard key.

The onkeypress event is triggered when you press a single character key on the keyboard.

The onkeyup event is triggered when a key on the keyboard is released.

A new Part Of The OnPaint event form is exposed for triggering.

The OnResize event is triggered when the form size is adjusted again.

The OnShow event is triggered instantly before the form is actually displayed.

Ord returns the ordinal number of the ordinal class.

OutlineStyle attribute type

OutOfMemoryError caused an OutOfMemory accident.

PageIndex attribute page index

Pages property page

The ParamCount function returns the number of parameters uploaded to the program on the command line.

The ParamStr function returns the specified command line parameter.

Pen attribute painter settings

Pi function returns the circumference Pi

Picture attribute display image

PictureClosed properties set Closed bitmap

PictureLeaf properties set Leaf bitmap

PictureMinus Property setting Minus bitmap

PictureOpen attribute setting Open bitmap

PicturePlus Property setting Plus bitmap

The Pos function searches for substrings in strings.

The Pred function returns the previous parameters.

The Random function returns a Random function.

The Randomize function initializes the built-in random number generator with a random number.

The Read function reads a file component to a variable for a formatted file;

Read one or more values from a text file to one or more variables.

The Readln function executes the Read process and jumps to the next row of the file.

ReadOnly attribute read-only attribute

ReAllocMem function allocates a dynamic variable

Rename function Rename external file

RenameFile function rename a file

The Reset function opens an existing file.

The Rewrite function creates and opens a new file.

The RmDir function deletes empty subdirectories.

The Round function rounds an integer value.

The RunError function stops program execution.

ScrollBars attribute scroll bar status

The Seek function moves the current pointer of the file to the specified component.

The SeekEof function returns the end state of the file.

The SeekEoln function returns the row end state of the object.

Select color

SetMemoryManager function set the entry point of the Memory Manager

The SetTextBuf function specifies the I/O buffer for text files.

Shape

The ShowException function displays unexpected messages and addresses.

Sin function sine function

Number of bytes returned by the SizeOf Function

Minimum value of the SmallChange attribute

Whether Sorted attributes allow sorting

Sqr Function Square Function

Square Root function of Sqrt Function

StartMargin attribute start edge

Current State of the State Property Control

The Str function converts a value to a string.

The StrAlloc function assigns a buffer with a maximum length of-1 to the string ending with NULL.

The StrBufSize function returns the maximum number of characters stored in the character buffer allocated by StrAlloc.

The StrCat function attaches a string to the end of another string and returns the merged string.

The StrComp function compares two strings.

The StrCopy function copies one string to another.

The StrDispose function releases the string on the stack.

The StrECopy function copies a string to another string and returns the pointer at the end of the result string.

The StrEnd function returns a pointer to the end of a string.

The Stretch attribute automatically adapts to the control size.

The StrFmt function is used to format a series of parameters.

The StrIComp function compares two strings (Case Insensitive)

The StringToWideChar function converts an ANSI string to a UNICODE string.

The StrLCat function attaches a character in a string to the end of another string and returns the merged string.

The StrLComp function compares two strings with the maximum length.

The StrLCopy function copies the characters in one string to another.

The StrLen function returns the number of characters in the string.

The StrLFmt function is used to format a series of parameters. The result contains a pointer to the target buffer zone.

The StrLIComp function compares two strings with the maximum length (Case Insensitive)

The StrLower function converts characters in a string to lowercase letters.

The StrMove function copies the characters in one string to another.

The StrNew function allocates a string on the stack.

The StrPas function converts a NULL string to a PASCAL string.

The StrPCopy function copies the strings of the PASCAL class as NULL-terminated strings.

The StrPLCopy function copies the maximum length string of the PASCAL class as a NULL-terminated string.

The StrPos function returns a pointer for the first time in another string.

The StrRScan function returns the pointer of the last character in the string.

The StrScan function returns the pointer with the first character in the string.

The StrToDate function converts a string to a date format.

The StrToDateTime function converts a string to the date/time format.

The StrToFloat function converts a given string to a floating point number.

The StrToInt function converts a string to an integer.

The StrToIntDef function converts a string to an integer or default value.

The StrToTime function converts a string to a time format.

The StrUpper function converts characters in a string to uppercase letters.

Select Style attribute type

The Suce function returns subsequent parameters.

Swap function switching Parameters

Tabs attribute to mark the content of each item

TabIndex attribute tag Index

Text displayed in the Text attribute

The TextToFloat function converts a string (in the format ending with NULL) to a floating point number.

The Time function returns the current Time.

The TimeToStr function converts the time format to a string.

The Trim function removes leading and trailing spaces and control characters from a given string.

The TrimLeft function removes leading spaces and control characters from a given string.

The TrimRight function removes trailing spaces and control characters from a given string.

The Trunc function truncates a real value into an integer value.

The Truncate function truncates the content after the current file location.

UnSelectedColor

UpCase converts characters to uppercase letters

UpperCase converts a given string to UpperCase.

The Val function converts a string to an integer.

The VarArrayCreate function creates a variant array based on the given boundary and dimension.

The VarArrayDimCount function returns the dimension of a given variant.

The VarArrayHighBound function returns the upper bound of the dimension of the given variant array.

The VarArrayLock function locks a given variant array.

The VarArrayLowBound function returns the lower bound of the given variant array dimension.

The VarArrayOf function returns the array elements of the specified variant.

The VarArrayRedim function adjusts the variation size by changing the upper limit.

The VarArrayUnlock function unlocks the specified variant array.

The VarAsType function converts a variant to a specified type.

The VarCase function converts a variant to a specified type and saves it.

The VarClear function clears the specified variant.

The VarCopy function copies the specified variant to the specified variant.

The VarFormDateTime function returns a variant containing the date and time.

VarIsArray function test whether the variant is an array

VarIsEmpty function test whether the variant is UNASSIGNED

VarIsNull function test whether the variant is NULL

The VarToDateTime function converts a given variant to the datetime type.

The VarType function converts the variant to the specified type and saves

Visibility of the Visible Property Control

When the WantReturns attribute is True, press the Enter key to generate a carriage return;

If it is False, press Ctrl + Enter to generate a carriage return.

The Write command writes a variable to a formatted file to the file component;

Write one or more values to a text file

The Writeln command executes the WRITE process, and then outputs the end mark of a row.

The WideCharLenToString function converts an ANSI string to a UNICODE string.

The WideCharLenToStrWar function converts a UNICODE string to an ANSI string variable.

The WideCharToString function converts a UNICODE string to an ANSI string.

The WideCharToStrVar function converts a UNICODE string to an ANSI string variable.

 

Procedure Inc (var X [; N: Longint]);

Add N to X (N can be saved, the default value is 1)

---------------------------------------------------------------

 

Equivalent to C ++.

Var y: integer;

Begin

Y: = 3;

Inc (y); // y = 4;

Inc (y, 4); // y = 8;

End;

---------------------------------------------------------------

 

The execution efficiency of Inc is higher than that of I: = I + n, which is similar to the ++ operator in C language. Similar functions are called Dec, and their usage is the same as that of Inc.

 

---------------------------------------------------------------

 

Look at the Delphi example.

 

Var

IntVar: Integer;

LongintVar: Longint;

Begin

Inc (IntVar); {IntVar: = IntVar + 1}

Inc (LongintVar, 5); {LongintVar: = LongintVar + 5}

 

End;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.