SRL Archive - SRL Suggestions

Shorten needed?


Naum

2009-04-21 18:17:16

In inventory.scar

- ClickAllItemsExcept

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:

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

JAD

2009-04-21 19:28:14

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

nielsie95

2009-04-21 19:49:41

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

lordsaturn

2009-04-22 06:30:58

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
arr: array[0..27] of integer;
begin
for i := 0 to 27 do
arr[i] := i+1;

Nava2

2009-04-22 17:15:42

From: lordsaturn
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
arr: array[0..27] of integer;
begin
for i := 0 to 27 do
arr[i] := i+1;


Not really worth it…

Wizzup?

2009-04-22 17:21:24

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

lordsaturn

2009-04-23 10:52:16

Agreed.