James Russell Posted June 5, 2013 Share Posted June 5, 2013 Hey all, Just wondering how I write the following IF statement. At the moment I have: IF (CkCnt=TRUE OR CkAll=TRUE) Then Begin End; Where CkCnt and CkAll are Booleans. I'm probably just missing a comma or bracket or semisomething or sleep. Any help appreciated. Cheers, J Quote Link to comment
Hippocode Posted June 5, 2013 Share Posted June 5, 2013 (edited) Each subpart has to be closed by brackets, in your case: IF (CkCnt=TRUE) OR (CkAll=TRUE) Then You can create complicated comparisons this way, and multiple subparts can be combined like this : IF ((CkCnt=TRUE) OR (CkAll=TRUE)) AND (x=y) Then Also in case of booleans, you can just write the variable, probably don't need the brackets this way: IF (CkCnt) OR (CkAll) Then Edited June 5, 2013 by hippothamus Quote Link to comment
Miguel Barrera Posted June 5, 2013 Share Posted June 5, 2013 You can also use the shortcut symbols | and &. In your case, the code would be IF CkCnt | CkAll THEN .... Quote Link to comment
James Russell Posted June 6, 2013 Author Share Posted June 6, 2013 (edited) Thanks guys, Great responses and examples. Cheers, J Edited June 6, 2013 by James Russell Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.