| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
For ordinal types:
procedure Inc (var x: ordinal type); |
procedure Inc (var x: ordinal type; Amount: Integer); |
For pointer types:
procedure Inc (var p: any pointer type); |
procedure Inc (var p: any pointer type; Amount: Integer); |
For ordinal types, `inc' increases the value of `x' by one or by `amount' if it is given.
If the argument `p' is pointing to a specified type (typed pointer), `inc' increases the address of `p' by the size of the type `p' is pointing to or by `amount' times that size respectively. If `p' is an untyped pointer (i.e. `p' is of type section 9.196 Pointer), `p' is increased by one.
`Inc' is a Borland Pascal extension. Yet application of `Inc' to pointers is defined in Borland Pascal. The combination of the second argument with application to pointers is a GNU extension.
program IncDemo;
var
Foo: Integer;
Bar: array [1 .. 5] of Integer;
Baz: ^Integer;
begin
Foo := 4;
Inc (Foo, 5); { yields 9 }
{$X+} { Turn on extended systax }
Baz := @Bar[1]; { Baz points to y[1] }
Inc (Baz, 2); { Baz points to y[3] }
end.
|
section 9.59 Dec, section 9.201 Pred, section 9.271 Succ, section 8.6 Pointer Arithmetics.