Operator list of Delphi

Source: Internet
Author: User
Tags integer division
Category Operator Operation Operands Result type Example
Arithmetic Operators + Add Integer, real number Integer, real number X + Y
- Subtraction Integer, real number Integer, real number Result-1
* Multiplication Integer, real number Integer, real number P * interestrate
/ Real Division Integer, real number Real Number X/2
Div Integer Division Integer Integer Total Div unitsize
MoD Modulo Integer Integer Y MOD 6
+ (One dollar) Equivalent symbol Integer, real number Integer, real number + 7
-(One dollar) Opposite symbol Integer, real number Integer, real number -X
Boolean operator Not No Boolean Boolean Not (C in myset)
And And Boolean Boolean Done and (total> 0)
Or Or Boolean Boolean A or B
XOR Exclusive or Boolean Boolean A XOR B
Logical (bitwise) Operators Not Bitwise Negation Integer Integer Not x
And Bitwise AND Integer Integer X and Y
Or By bit or Integer Integer X or Y
XOR Bitwise OR Integer Integer X xor y
SHL Shift left by bit Integer Integer X shl 2
SHR Shift right by bit Integer Integer Y SHR I
String Operators + Connection String, compressed string, Character String S + '.'
Pointer Operator + Pointer Addition Character pointer, integer Character pointer P + I
- Pointer Subtraction Character pointer, integer Character pointer, integer P-Q
^ Pointer release reference Pointer Base type of pointer P ^
= Equal Pointer Boolean P = Q
<> Not Supported Pointer Boolean P <> q
Set Operators + Union Set Set Set1 + set2
- Difference set Set Set S-T
* Intersection Set Set S * t
<= Subset Set Boolean Q <= myset
> = Superset Set Boolean S1> = S2
= Equal Set Boolean S2 = myset
<> Not Supported Set Boolean Myset <> S1
In Member Ordinal number, Set Boolean A In set1
Relational operators = Equal Simple type, class, class reference, interface, String, compression string Boolean I = max
<> Not Supported Simple type, class, class reference, interface, String, compression string Boolean X <> Y
< Less Simple type, String, compression string, pchar Boolean X <Y
> Greater Simple type, String, compression string, pchar Boolean Len> 0
<= Less than or equal Simple type, String, compression string, pchar Boolean CNT <= 1
> = Greater than or equal Simple type, String, compression string, pchar Boolean I> = 1
Class Operators As Conversion Class and Class instance
Is Judgment
= Relational operators = and <> also act on classes
<>
Address (@) Operator @ X If X is a variable, @ x returns the address of X.
When the Compilation instruction {$ T-} is valid, @ X is of the pointer type;
In the Compilation instruction {$ t +}, @ X is of the ^ T type, where T is of the X type.
@ F If F is a routine (function or process), @ F returns
The entry point of F. The type of @ F is always pointer.
@ Method in class When @ applies to methods defined in the class, the method identifier must be limited by the class name. Example: @ tmyclass. dosomething

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.