Topic: Need a little help with a Script (easy)
I managed to overwrite my script.pas file and I'm having to start over. I have a simple script for saving a email address, and then the address shows up as a link.. I do it on two forms. The problem I'm having is that it works on one form, but not on the other. Need some fresh eyes...
procedure form1_Edit1_OnChange (Sender: string);
begin
if Pos('@', Form1.Edit1.Text)>0 then
begin
Form1.Edit1.Cursor := crHandPoint;
Form1.Edit1.Font.Style:=fsUnderline;
Form1.Edit1.Font.Color := clHotLight;
end
else
begin
Form1.Edit1.Cursor := crDefault;
Form1.Edit1.Font.Style:=0;
Form1.Edit1.Font.Color := clDefault;
end;
MessageDlgTimeOut('You are here: Form1_Edit1_onChange', 'Form1', MB_YESNO+MB_ICONINFORMATION, 2000); // 2 seconds
end;
procedure Form1_Edit1_OnDoubleClick (Sender: string);
begin
OpenFile('mailto:'+Form1.Edit1.Text);
end;
procedure PetTransport_Email_OnChange (Sender: string);
begin
if Pos('@', PetTransport.Email.Text)>0 then
begin
PetTransport.Email.Cursor := crHandPoint;
PetTransport.Email.Font.Style:=fsUnderline;
PetTransport.Email.Font.Color := clHotLight;
end
else
begin
PetTransport.Email.Cursor := crDefault;
PetTransport.Email.Font.Style:=0;
PetTransport.Email.Font.Color := clDefault;
end;
MessageDlgTimeOut('You are here: PetTransport_Email_OnChange', 'Pet Transport', MB_YESNO+MB_ICONINFORMATION, 2000); // 2 seconds
end;
procedure PetTransport_Email_OnDoubleClick (Sender: string);
begin
OpenFile('mailto:'+PetTransport.Email.Text);
end;
begin
StartPage.mniAbout.Visible := False;
StartPage.mniOptions.Visible := False;
StartPage.mniFile.Visible := False;
end.
The email link work just fine on Form1, but not on the "PetTransport" form. The message box works on Form1 but not on PetTransport. So I don't think it's ever making it to that part of the code. I would appreciate any help
Scott Adams