SRL Archive - OSR Help

How to add to arrays


Troll

2011-02-13 13:08:10

Short and hopefuly simple

How do i added to an array on the run
For example

Array := [a,b,d,e]

and i want to add c, so how can i do that?

THanks for your time and help :)

E: takes and secound question

would this work?


Array := [a,b,c,d]
Array := Array - Array[2]
To take the B out?

Thanks again

**BANNED The Man

2011-02-13 13:11:06

Array := Array + c;

Naum

2011-02-13 13:14:35

Var X, Y, I, C : Integer;
Arr : TStringArray;

Begin
Arr := [];
Repeat
Inc(C);
SetLength(Arr, C + 1);
Arr[C] := 'lol'+IntToStr(c);
Until(C = 100);
WriteLn(Arr[8]);
End.

Should explain it for you :)

Troll

2011-02-13 13:14:51

Really? That simple thanks thats great