Page 1 of 1

How to do anything at all

Posted: Sat Aug 15, 2009 2:53 pm
by Geoff
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.

Posted: Sat Aug 15, 2009 5:40 pm
by Janschenkel
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.

Posted: Sat Aug 15, 2009 9:01 pm
by Geoff
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.