Inc

From Soldat Community Wiki
Revision as of 09:27, 15 August 2012 by Freeman (talk | contribs) (Created page with "===From the Scripting Manual=== ''procedure inc(var X: integer; N: integer);'' '''Parameter Info:''' variable X (Integer): Numeric variable to increase by N (see below) ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

From the Scripting Manual

procedure inc(var X: integer; N: integer);

Parameter Info:
 variable X (Integer): Numeric variable to increase by N (see below)
 N (Integer): Number to increment X by.

Description:
 This function will increment (increase) the value of an integer by whatever number you specify in the  N field. See below for an example:

Examples

var
MyNumber: integer;
begin
    MyNumber := 0;
    WriteLn(inttostr(MyNumber)); // 0
    inc(MyNumber,1);
    WriteLn(inttostr(MyNumber)); // 1
    inc(MyNumber,6);
    WriteLn(inttostr(MyNumber)); // 7
    inc(MyNumber,13);
    WriteLn(inttostr(MyNumber)); // 20
end;


External Links