Solved

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

Posted on 2006-07-05
2
184 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now