Go to the Next or Previous section, the Detailed Contents, or the Amiga E Encyclopedia.


10.5.1 INC and DEC statements

INC x is the same as the statement x:=x+1. However, because it doesn't do an addition it's a bit more efficient. Similarly, DEC x is the same as x:=x-1.

The observant reader may think that INC and DEC are the same as ++ and -. But there's one important difference: INC x always increases x by one, whereas x++ may increase x by more than one depending on the type to which x points. For example, if x were a pointer to INT then x++ would increase x by two (INT is 16-bit, which is two bytes).


Go to the Next or Previous section, the Detailed Contents, or the Amiga E Encyclopedia.