Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function TIAPosMultiEx(TIA, ints: TIntArray): TIntArray;
- var
- i, h, r: Integer;
- begin
- h := High(TIA);
- if ((High(ints) > -1) and (h > -1)) then
- begin
- SetLength(Result, (h + 1));
- for i := 0 to h do
- if TIAContains(ints, TIA[i]) then
- begin
- Result[r] := i;
- Inc(r);
- end;
- end;
- SetLength(Result, r);
- end;
- var
- TIA: TIntArray;
- begin
- ClearDebug;
- SetLength(TIA, 20);
- FillTIAEx(TIA, [1, 2, 3, 4, 5]);
- WriteLn(TIAToStr(TIA));
- WriteLn('[1, 5] positions in TIA: ' + TIAToStr(TIAPosMulti(TIA, [1, 5])));
- SetLength(TIA, 0);
- end.
Advertisement
Add Comment
Please, Sign In to add comment