Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

the if statement

Status
Not open for further replies.

delphinewbie

Programmer
Dec 10, 2003
14
0
0
MY
Can somebody correct and give me the valid if statement? I have this:

if (WordWrap1.Checked := True) then begin
mainFrm.WordWrap1.Checked := False;
else
mainFrm.WordWrap1.Checked := True;
end;

end;
end;

Can somebody show me the right way? Thanks!
 
if WordWrap1.Checked = True then
begin
WordWrap1.Checked := False;
else
WordWrap1.Checked := True;
end;
 
the else statement isn't working for some reason :(. I get error saying:

';' not allowed before 'ELSE'

 
Try this:

if WordWrap1.Checked = True then
WordWrap1.Checked := False
else
WordWrap1.Checked := True;


Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
Never put ; behind else because the command is not finished yet.

For boolean evaluation use =

For value assignment use := Steven van Els
SAvanEls@cq-link.sr
 
Sorry about the ;

I tend to let the compiler catch those.
 
use expression to 'toggle' the boolean value:-

with mainFrm.WordWrap1 do
checked := not checked;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top