Topic: Would someone tell my what's wrong with this script?

I hope you all don't mind me making so many posts. I do apologize. So, I have a script that I think is acting odd. As a disclaimer, I haven't used Pascal since I was in college (a long time ago). Here's the script;

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;
end;

procedure Form1_Edit1_OnDoubleClick (Sender: string);
begin
    OpenFile('mailto:'+Form1.Edit1.Text);
end;

begin
    frmMain.mniAbout.Visible := False;
    frmMain.mniOptions.Visible := False;   
//    frmMain.mniFile.Visible := False;
end.


procedure form1_Edit1_OnDoubleClick (Sender: string);
begin
    OpenFile('mailto:'+Form1.Edit1.Text);
end;

end.

The section that I'm curious about is the fromMain.mni(file, options, about). When I use // to comment out some code, for me it's working in reverse. If I comment out the File Menu, the File Menu is the only thing that shows up. And if I comment out  the Options line, then it shows up.

I must be doing something wrong somewhere. Maybe someone can point out where I messing up...
thanks

Nothing inspires forgiveness quite like revenge.

Scott Adams

Re: Would someone tell my what's wrong with this script?

All code after end. will be ignored.

right code is:

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;
end;

procedure Form1_Edit1_OnDoubleClick (Sender: string);
begin
    OpenFile('mailto:'+Form1.Edit1.Text);
end;


procedure form1_Edit1_OnDoubleClick (Sender: string);
begin
    OpenFile('mailto:'+Form1.Edit1.Text);
end;

begin
    frmMain.mniAbout.Visible := False;
    frmMain.mniOptions.Visible := False;   
//    frmMain.mniFile.Visible := False;
end.

block

begin

end.

must be placed in the end of script.

Dmitry.

Re: Would someone tell my what's wrong with this script?

Thanks Dmitry, looks like I'm going to have to brush up on my Pascal/Delphi. Every thing is working good now. +1

Nothing inspires forgiveness quite like revenge.

Scott Adams

Re: Would someone tell my what's wrong with this script?

One more question... What's the best free IDE for Pascal? (if there is such a thing)

Nothing inspires forgiveness quite like revenge.

Scott Adams

Re: Would someone tell my what's wrong with this script?

jumper wrote:

One more question... What's the best free IDE for Pascal? (if there is such a thing)

May be Lazarus.

Dmitry.

Re: Would someone tell my what's wrong with this script?

Seems to me MVD is already a very nice RAD smile

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: Would someone tell my what's wrong with this script?

Hello All

I vote so for Lazarus : Strong and Free.
MVD is a variation of RAD XE from Embarcadero with all properties not yet activated.

JB

Re: Would someone tell my what's wrong with this script?

Thanks for the tip on Lazarus, I wish I could use MVDB in native mode on MAC OS X to develop on this platform smile

Re: Would someone tell my what's wrong with this script?

Thanks for the tip about Lazarus. I will check it out. I know that vbd has the internal script for Pascal, I just thought an IDE might give me some hints if I write something stupid :

I will check it out...

Nothing inspires forgiveness quite like revenge.

Scott Adams