Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
problem when i try to pack my dll file with upx 9 71
Convert Jpg /PNG To GIF 5 118
LAN or WAN ? 11 81
Firemonkey android show image from resource ? 1 32
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

17 Experts available now in Live!

Get 1:1 Help Now