Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2006-07-05
2
Medium Priority
?
192 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

972 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