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
"" ? 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 .
Inc :
Inc(MyVar, X);
procedure Inc(var X [ ; N: longint ] ); Inc(avar) Inc(avar, 10)
N
procedure Dec(var X [ ; N: longint ] ); Dec(avar); Dec(avar, 10);
N.
"Do and Assign", += -=, Delphi - , , .
+=
-=
delphi :
? x = x + 1 x + = 1 , ( ). Delphi , x: = x + 1 . : . "", .
Source: https://habr.com/ru/post/1721604/More articles:Parsing an array of JSON objects - javaR lag from missing data - rJavaScript source request - javascriptC # - Am I replacing perfectly good code? - c #Python: Lazy String Decoding - pythonПроектирование карьеров и компиляторов - curryingHow to prevent GCC flags from passing by default? - linuxSpring, iBatis, MySQL - how to manage transactions? - springIn-App Subscription Question - iphoneHow many possible URLs can you make with the following characters? - mathAll Articles