Skip to Content
Absolute Beginner's Guide to Programming, Third Edition
book

Absolute Beginner's Guide to Programming, Third Edition

by Greg Perry
November 2002
Beginner content levelBeginner
432 pages
11h 44m
English
Que
Content preview from Absolute Beginner's Guide to Programming, Third Edition

Making Decisions in Code

One of the most important statements in a program is the If statement. With the logic that If provides, your application can begin to analyze data and make decisions based on the analysis. For example, your program can display a three-button message box and determine, with the If statement, which command button the user should click to close the message box.

If uses the comparison operators you learned in the previous chapters, such as < and >=. If performs one of two possible code actions, depending on the result of the comparison. In other words, If uses a comparison operator result to test data and might execute one or more lines of subsequent code, depending on the result.

Before If, code was executed sequentially, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Absolute Beginner's Guide to Programming, Second Edition

Absolute Beginner's Guide to Programming, Second Edition

Greg Perry

Publisher Resources

ISBN: 0789729059Purchase book