Results 1 to 4 of 4

Thread: Is this the same thing?

  1. #1
    Join Date
    Oct 2011
    Location
    Australia, Vic
    Posts
    1,517
    Mentioned
    2 Post(s)
    Quoted
    120 Post(s)

    Default Is this the same thing?

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

    ~John

  2. #2
    Join Date
    Dec 2011
    Location
    The Netherlands
    Posts
    1,631
    Mentioned
    47 Post(s)
    Quoted
    254 Post(s)

    Default

    No, inc does simply increase an integer with one.

    Simba Code:
    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:
    Simba Code:
    SRL Compiled in 16 msec
    ExpGained: 387
    ExpGained2: 387
    Successfully executed.

    Script source code available here: Github

  3. #3
    Join Date
    Oct 2011
    Location
    Australia, Vic
    Posts
    1,517
    Mentioned
    2 Post(s)
    Quoted
    120 Post(s)

    Default

    ok ty

  4. #4
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Just so you know:


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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •