11EVENT-DRIVEN PROGRAMMING

image

So far, the programs you’ve written have been mostly sequential because they have followed the lines of code in order, from top to bottom. Some statements might have made a comparison or called a subroutine to take a detour, but overall the order of statements has been mostly linear.

In some ways, this is comparable to how you go about your daily routine: you wake up, make your bed, take a shower, eat your breakfast, watch TV, comb your hair, and so on. But what if the phone rings during your routine? If you’re expecting a call from a friend to confirm that night’s party, you’d better take it! Even though you’re doing ...

Get Learn to Program with Small Basic now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.