Solved

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

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

829 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