Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {==============================================================================]
- Explanation: Returns true if TSA1 is identical with TSA2.
- [==============================================================================}
- function TSAEquals(TSA1, TSA2: TStrArray): Boolean;
- var
- h, i: Integer;
- begin
- Result := False;
- h := High(TSA1);
- if (h = High(TSA2)) then
- begin
- for i := 0 to h do
- if (TSA1[i] <> TSA2[i]) then
- Exit;
- Result := True;
- end;
- end;
- begin
- ClearDebug;
- if TSAEquals(['a', 'b', 'c'], ['a', 'b', 'c', 'd']) then
- WriteLn('WTF!');
- if TSAEquals(['a', 'b', 'c', 'd'], ['a', 'b', 'c']) then
- WriteLn('WTF!');
- if TSAEquals(['a', 'b', 'c', 'd'], ['a', 'b', 'c', 'd']) then
- WriteLn('YAY!');
- end.
Advertisement
Add Comment
Please, Sign In to add comment