Solved

Follow up on: I want to copy the favorites....

Posted on 2006-07-05
2
186 Views
Last Modified: 2010-04-05
Hey

I have modified various parts of my program, as was advised to me by Rllibby, and I now have the following question.

I have created 2 memoboxes [mmo1 + mmo2], with lines of text in them [help for the user], now i have also created a checkbox which, if checked, shows them to the user [after next restart], this all goes well, as long as I only use one memobox, i have a hard time with performing more than one action after an [If... Then] statement, as shown below


procedure TForm1.FormCreate(Sender: TObject);
Begin
   stat1.Panels[0].Text:=' FavoriteHell v1.0';
   Inifile := TIniFile.Create(Changefileext(application.exename, ' .INI'));
  with Inifile do
      begin
        showhelp:= ReadBool('Help','showhelp',True);
        chk1.Checked:=showhelp;
        if showhelp then mmo1.Visible:= True; //memo 1 is visible
        if mmo1.Visible:= True then mmo2.Visible:= True; //this does not work:(
        free;
      end;

end;

Neither did this work:

procedure TForm1.FormCreate(Sender: TObject);
Begin
    stat1.Panels[0].Text:=' FavoriteHell v1.0';
   Inifile := TIniFile.Create(Changefileext(application.exename, ' .INI'));
  with Inifile do
      begin
        showhelp:= ReadBool('Help','showhelp',True);
        chk1.Checked:=showhelp;
        if showhelp then mmo1.Visible:= True and mmo2.visible:= true;
        free;
      end;

end;


How can the above be fixed?

Fdehell
0
Comment
Question by:fdehell
2 Comments
 
LVL 26

Accepted Solution

by:
Russell Libby earned 500 total points
ID: 17044288

 // Need to test equality, not perform an assignment  
 if mmo1.Visible:= True then mmo2.Visible:= True; //this does not work:(

should be

  if mmo1.Visible then mmo2.Visible:=True;


// two assignments, not an and operation
if showhelp then mmo1.Visible:= True and mmo2.visible:= true;

should be

if showhelp then
begin
 mmo1.Visible:=True;
 mmo2.Visible:=True;
end;


---

Regards,
Russell


0
 
LVL 1

Author Comment

by:fdehell
ID: 17044678
thank you sooo much!!!


Fdehell
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
delphi prevent click fast 2 216
Delphi - replicating a form 8 74
how can i search if string exist in array ? 3 56
RESTRequest Parameter 4 30
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question