O'Reilly logo

LiveCode Mobile Development HOTSHOT by Edward D Lavieri Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Evaluating user input

Our Hello Planet! app does take user input. The OK button must be tapped and that tap is something we can capture and potentially assign code to. What do we know about this button? We know that the user taps it (when they do). We also know at what date and time they tap it.

Engage Thrusters

So, let's count how many seconds it takes the user to tap that button. Here is the code:

on openStack global theStart local theTime put the seconds into theStart put the time into theTime answer "Greetings!" & return & theTime titled "Hello Planet!" timeup end openStack command timeup global theStart local theEnd put the seconds into theEnd answer "It took you " & (theEnd - theStart) & " seconds to tap that button!" titled "I was Counting" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required