Janilabo

Janilabo | TIAPosMulti() [SCAR Divi]

May 8th, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.55 KB | None | 0 0
  1. function TIAPosMulti(TIA, ints: TIntArray): TIntArray;
  2. var
  3.   i, h: Integer;
  4. begin
  5.   h := High(ints);            
  6.   if ((High(TIA) > -1) and (h > -1)) then
  7.   begin
  8.     SetLength(Result, (h + 1));
  9.     for i := 0 to h do  
  10.       Result[i] := TIAPos(TIA, ints[i]);
  11.   end else
  12.     SetLength(Result, 0);
  13. end;
  14.  
  15. var
  16.   TIA: TIntArray;
  17.  
  18. begin
  19.   ClearDebug;
  20.   SetLength(TIA, 20);
  21.   FillTIAEx(TIA, [1, 2, 3, 4, 5]);
  22.   WriteLn(TIAToStr(TIA));
  23.   WriteLn('[1, 5, 9] positions in TIA: ' + TIAToStr(TIAPosMulti(TIA, [1, 5, 9])));
  24.   SetLength(TIA, 0);
  25. end.
Advertisement
Add Comment
Please, Sign In to add comment