Ok lets say i got this.
SCAR Code:Item := [995, ArrowID[0], ArrowID[1], ArrowID[2], ArrowID[3], ArrowID[4]];
and i want to add to the value of Item
SCAR Code:ids:tintegerarray
I can't just do
SCAR Code:Item := Ids, [blah,blah];
So help?
Ok lets say i got this.
SCAR Code:Item := [995, ArrowID[0], ArrowID[1], ArrowID[2], ArrowID[3], ArrowID[4]];
and i want to add to the value of Item
SCAR Code:ids:tintegerarray
I can't just do
SCAR Code:Item := Ids, [blah,blah];
So help?
I do visit every 2-6 months
SCAR Code:function CombineIntArray(Ar1:TIntegerArray;Ar2:TIntegerArray):TIntegerArray;
ty
What about combining strings?
I do visit every 2-6 months
Are you really going to do this or do you want me to make something for you to do that?
I need it for my script, so I will use it.
I do visit every 2-6 months
SCAR Code:var Strings: TStringArray; StringtoAdd: String;
begin
L := GetArrayLength(Strings);
SetArrayLength(Strings, L+1);
Strings[L] := StringtoAdd;
end.
get the idea?
“Ignorance, the root and the stem of every evil.”
SCAR Code:function CombineStrArray(A1, A2 : TStringArray) : TStringArray;
var
i : integer;
begin
for i := 0 to GetArrayLength(A1) - 1 do
begin
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := A1[i];
end;
for i := 0 to GetArrayLength(A2) - 1 do
begin
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := A2[i];
end;
end;
Last edited by Da 0wner; 05-11-2009 at 10:17 AM.
Woot ty. I gave you creds on that procedure in my script.
I do visit every 2-6 months
haha nice!Its actually pretty cool! I never knew it wasn't already in SCAR!
Did you check arrayLoader.scar for these?
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
I doubt he did as it is not a core file and not included by default.
If there is one in there use that one :P.
@Da Owner: Just noting that that code could be optimized quite a bit:
SCAR Code:function CombineStrArray(A1, A2 : TStringArray) : TStringArray;
var
i, A1L, A2L : integer;
begin
SetLength(Result, Length(A1) + Length(A2));
A1L := high(A1);
A2L := high(A2);
for i := 0 to A1L do
Result[i] := A1[i];
for i := 0 to A2L do
Result[A1L + 1 + i] := A2[i];
end;
Interested in C# and Electrical Engineering? This might interest you.
Yes, I know.
SetArrayLength is faster than SetLength and GetArrayLength is faster than High though.
True, but the couple 1/000000 seconds saved isn't worth my typing
It really only makes a difference in the looping, know what I mean?
Interested in C# and Electrical Engineering? This might interest you.
Oh yea, calling it every time XD.
There are currently 1 users browsing this thread. (0 members and 1 guests)