Does delphi have some fast operators? (+ =, - =, ...)

Very simple question, but I could not find the answer on google

In delphi, is there a way to shorten this type of code:

MyVar := MyVar + X;

As in C ++, I would do MyVar + = X ;. Given how trivial and useful it should be a way, but I cannot find any option for this somewhere ...

Thanks for any help

+3
source share
6 answers

"" ? Inc Dec, , + = - =, . , , x: = x + 1;

, ( $ff) Inc (MyVar, x)

// Inc(MyVar, x);
  add bl, x

x: = x + 1;

// x := x + 1;
  movzx eax,bl
  movzx edx, x
  add eax,edx
  cmp eax,$000000ff
  jbe success
  call @BoundErr
success:
  mov ebx,eax

, .

, , Inc .

+19

Inc :

Inc(MyVar, X);
+6

, .

procedure Inc(var X [ ; N: longint ] );
Inc(avar)
Inc(avar, 10)

N

procedure Dec(var X [ ; N: longint ] );
Dec(avar);
Dec(avar, 10);

N.

+5
Inc(MyVar, X);

, .

+2

"Do and Assign", += -=, Delphi - , , .

+1

delphi :

? x = x + 1 x + = 1 , ( ). Delphi , x: = x + 1 . : . "", .

+1

Source: https://habr.com/ru/post/1721604/


All Articles