How to do anything at all

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Geoff
Posts: 2
Joined: Sat Aug 15, 2009 8:25 am

How to do anything at all

Post by Geoff » Sat Aug 15, 2009 2:53 pm

I have had Revolution Media for two months now.
I am extremely frustrated that I have not yet produced the simplest of programs.
I was reassured a little when I read Andycal's "An Epithany" (16th June in the general discussion forum).

To get me started, could someone tell me how to write a program that
a) gets a number from the user, then
b) displays the result of that number multiplied by 2, on an output window?
Regards, Geoff.

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Sat Aug 15, 2009 5:40 pm

That could be as simple as a button with script:

Code: Select all

on mouseUp
  ask "Please enter a number"
  answer it && "multiplied by 2 is" && (it * 2)
end mouseUp
Like any programming language, rev takes some getting used to it. But this forum and the use-revolution mailing list are excelloent resources when you need a hand.

HTH,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Geoff
Posts: 2
Joined: Sat Aug 15, 2009 8:25 am

Post by Geoff » Sat Aug 15, 2009 9:01 pm

Thank you, Jan, it worked.
I have now written my first Rev program.
I noticed that the button was designated as a "handler", and I am now going to read about the different types of handlers in the user's guide.
I may be back.
Thanks again, Geoff.

Post Reply