Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Anders Hejlsberg - What brought about the birth of the CLR?
Aug 01, 2005 at 12:32 AMhttp://www.blong.com/images/Eggs/Delphi1d.gif
Gary Daniels and Evan Goldring - Mock whiteboard problem
Aug 01, 2005 at 12:00 AMNot very efficient, and not even a MS product, but here is my interpretation. I'm not horribly efficient, but oh well.
......
type
TPalindromeResult = (prTrue, prFalse, prLengthMismatch, prException);
......
procedure TForm1.Button1Click(Sender: TObject);
begin
Case IsPalindrome(edit1.Text, edit2.Text) of
prTrue:
MessageDlg('You the man',mtInformation,[mbOk],0);
prFalse:
MessageDlg('You not the man', mtInformation, [mbOk],0);
prLengthMismatch:
MessageDlg('Can''t compare, length mismatch', mtInformation, [mbOk],0);
End;
end;
......
function TForm1.IsPalindrome(Str1, Str2: String): TPalindromeResult;
Var
WorkStr : String;
X : Integer;
begin
Try
Try
//Perform basic checks before iteration.
If (Length(Str1) <> Length(Str2)) Then Begin
Result := prLengthMismatch;
Exit;
End;
For X := 1 to Length(Str1) do
Insert(Copy(Str2,X,1),WorkStr,0);
If (WorkStr = Str1) Then
Result := prTrue
Else
Result := prFalse;
Except
On Exception do Result := prException;
End;
Finally
//Perform any necessary cleanup
End;