SRL Archive - Help

Is this the same thing?


John

2012-05-13 05:21:38

Is this:
ExpGained := ExpGained + 387;
The Same as This:
Inc(ExpGained + 387);
Thanks

~John

J J

2012-05-13 05:30:19

No, inc does simply increase an integer with one.

program Test;
{$i srl/srl.simba}

procedure Test;
var
ExpGained, ExpGained2: Integer;

begin
ExpGained := (ExpGained + 387);
WriteLn('ExpGained: '+IntToStr(ExpGained)+'');

IncEx(ExpGained2, 387);
WriteLn('ExpGained2: '+IntToStr(ExpGained2)+'');
end;

begin
SetupSRL;
Test;
end.

IncEx does increase an Integer with a number you can specify.
Inc(ExpGained + 387) will also give a compiling error.

Script above:
SRL Compiled in 16 msec
ExpGained: 387
ExpGained2: 387
Successfully executed.

John

2012-05-13 05:39:42

ok ty

Abu

2012-05-13 16:54:35

Just so you know:


This:
ExpGained := ExpGained + 387;
IS the Same as This:
IncEx(ExpGained, 387);