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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If statement help 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
why dont this work for me . I have delphi 6

if check1.Checked = true then;
cancel := true ;
else ;
cancel := false ;
end if ;
end;
 
Try :
if check1.Checked = true then
cancel := true ;
else
cancel := false ;

Lose the endif and the semi-colons.
Steve
 
Small correction

if check1.Checked = true then
cancel := true
else
cancel := false ;

rules:
1) No semicolon after then
2) No semicolon before else
3) No semicolon after else
4) No end if
5) Every begin must have an end (execept in some cases) {case & try}

Regards


S. van Els
SAvanEls@cq-link.sr
 
Just one thing.. if the if exemple u gave us is really what u want to do .. u r better with that line.

cancel:=check1.Checked;

second : there is a lot of IF exemple in delphi. just underline an IF keyword in your code and press F1.

jb



 
hi all,

You all got the if statement wrong !!!
it should look like this:

if check1.Checked then
cancel := true
else
cancel := false ;


btw what the h*ll is 'cancel' ???

I hope this helps,

BobbaFet Everyone has a right to my opinion.
E-mail me at cwcon@programmer.net
Be a nice guy 'n press that little ol' button
VVV---(this one) for me ;-)
 
Cancel is variable GWizJay defined. In Delphi you have many ways to acomplish a thing.

Regards S. van Els
SAvanEls@cq-link.sr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top