List of operators for Delphi

Source: Internet
Author: User
Tags bitwise class operator

category operator Operation Number of operands result Type Example
Arithmetic operators + Add integers, real numbers integers, real numbers X + Y
- Reducing integers, real numbers integers, real numbers Result-1
* By integers, real numbers integers, real numbers P * InterestRate
/ Real number In addition integers, real numbers Real X/2
Div Integer except Integer Integer Total Div unitsize
MoD Take the mold Integer Integer Y MoD 6
+ (one yuan) Symbolic equivalents integers, real numbers integers, real numbers +7
-(one Yuan) Symbol opposite integers, real numbers integers, real numbers -X
Boolean operator Not Negative Boolean type Boolean Not (C in MySet)
and And Boolean type Boolean Done and (Total > 0)
Or Or Boolean type Boolean A or B
Xor XOR or Boolean type Boolean A XOR B
Logical (bitwise) operator Not Bitwise negation Integer Integer Not X
and Bitwise-AND Integer Integer X and Y
Or Bitwise OR Integer Integer X or Y
Xor Bitwise XOR OR Integer Integer X XOR Y
Shl Bitwise LEFT Shift Integer Integer X SHL 2
Shr Bitwise RIGHT SHIFT Integer Integer Y SHR I
String operators + Connection string, compressed string, character String S + '. '
Pointer operators + Pointer Plus Character pointer, integer Character pointer P + I
- Pointer minus Character pointer, integer Character pointer, integer P-q
^ Pointer dismiss reference Pointer Base type of pointer p^
= Equal Pointer Boolean P = Q
<> Range Pointer Boolean P <> Q
Set operators + and set Collection Collection Set1 + Set2
- Subtraction Collection Collection S–t
* Intersection Collection Collection S * T
<= Subset Collection Boolean Q <= MySet
>= Hyper-Set Collection Boolean S1 >= S2
= Equal Collection Boolean S2 = MySet
<> Range Collection Boolean MySet <> S1
Inch Members Ordinal, set Boolean A in Set1
Relational operators = Equal Simple types, classes, class references, interfaces, strings, compressed strings Boolean I = Max
<> Range Simple types, classes, class references, interfaces, strings, compressed strings Boolean X <> Y
< Less than Simple type, string, compressed string, PChar Boolean X < Y
> Greater than Simple type, string, compressed string, PChar Boolean Len > 0
<= Less than or equal to Simple type, string, compressed string, PChar Boolean Cnt <= 1
>= Greater than or equal to Simple type, string, compressed string, PChar Boolean I >= 1
Class operator As Transformation Instances of classes and classes
Is Judge
= Relational operators = and <> are also used for classes
<>
Address (@) operator @X If x is a variable, then @x returns the address of X.  When the compilation indicator {$T-} is valid, @x is the pointer type; When the compiler indicates {$T +} state, @x is the ^t type, where T is the type of x.
@F If f is a routine (function or procedure), then @f returns the entry point of F, and the type of @f is always pointer.
Methods in the @ class When @ is applied to a method defined in a class, the method identifier must be qualified by the name of the class. For example: @TMyClass. dosomething

List of operators for Delphi

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.