xxpoopyxx
2013-03-12 19:49:18
how can i write an index of an array?
WriteLn(Array[RandomRange(0,ArrayLength)]);
2013-03-12 19:49:18
WriteLn(Array[RandomRange(0,ArrayLength)]);
2013-03-12 20:03:26
var
index: Integer;
TSA: TStringArray;
TIA: TIntegerArray;
begin
index := 2;
TSA := ['hello', 'world', 'foo'];
Writeln('Index of TSA[' + IntToStr(index) + '], string value: ' + TSA[index]);
// or
TIA := [0, 1, 2];
Writeln('Index of TIA[' + IntToStr(index) + '], Integer value: ' + IntToStr(TIA[index]));
end.
2013-03-12 20:22:16