Results 1 to 7 of 7

Thread: Shorten needed?

  1. #1
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default Shorten needed?

    In inventory.scar

    - ClickAllItemsExcept

    SCAR Code:
    function ClickAllItemsExcept(Identifier: Integer; ItemType, option: string; SlotIgnores: TIntegerArray; waitnum: Integer; tol: TIntegerArray):Integer;
    var
      i, x, y: Integer;
      TB: Tbox;
      arr:array of Integer;
    begin
      Result := 0;

      arr :=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,
          18,19,20,21,22,23,24,25,26,27,28];

    Shorten the Arr to:

    SCAR Code:
    function ClickAllItemsExcept(Identifier: Integer; ItemType, option: string; SlotIgnores: TIntegerArray; waitnum: Integer; tol: TIntegerArray):Integer;
    var
      i, x, y: Integer;
      TB: Tbox;
      arr:array of Integer;
    begin
      Result := 0;

      arr :=[1..28];



    Can also be done in DropAll in inventory.scar

  2. #2
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Couldn't it also be done right in the variable declaration?

  3. #3
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    That doesn't work on older versions of SCAR (is it even possible with the new one?)..

  4. #4
    Join Date
    Mar 2007
    Posts
    1,700
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    This won't compile in either 3.15 or 3.20..

    If you were to shorten it at all it would have to be done like
    SCAR Code:
    arr: array[0..27] of integer;
    begin
      for i := 0 to 27 do
        arr[i] := i+1;
    Last edited by lordsaturn; 04-22-2009 at 10:46 AM.

  5. #5
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by lordsaturn View Post
    This won't compile in either 3.15 or 3.20..

    If you were to shorten it at all it would have to be done like
    SCAR Code:
    arr: array[0..27] of integer;
    begin
      for i := 0 to 27 do
        arr[i] := i+1;
    Not really worth it...
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  6. #6
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Plus, it is best to stick to the normal Pascal Conventions.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  7. #7
    Join Date
    Mar 2007
    Posts
    1,700
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Agreed.

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
  •