Hello World!

This lesson will show you how to create your first app with LiveCode.

Opening LiveCode

Opening LiveCode

Start LiveCode, you will see the Integrated Development Environment or IDE.

Creating a new mainstack

Creating a new mainstack

Select New Stack - Default Size from the File menu. Every project you create in LiveCode is a stack.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              

New stack

New stack

This is a new stack, it is a blank canvas ready for you to start creating your app.

Creating a button

Creating a button

Drag a button from the Tools Palette onto the stack.

Opening the Code Editor

Opening the Code Editor

Click the Code button in the MenuBar to open the Code Editor for the button

Adding code to the button

Adding code to the button

When you open the Code Editor for the button you will see it is pre-populated with an on mouseUp handler. The code you add in here will be executed when the mouse is clicked and released over the button.

Adding code to the button (2)

Adding code to the button (2)

Add the code

answer "Hello World!"

to the button.

The answer command

The answer command displays a dialog box with a message to the user.

Applying the new code

Applying the new code

Click the Apply(1) button. The indicator(2) will turn green to show there are no errors.

Run mode

Run mode

Switch to Run mode to interact with the app.

Testing the button

Testing the button

Click the button.

The dialog box

The dialog box

After clicking the button you will see the message

    Hello World!

Click OK to dismiss the dialog.

27 Comments

Ivan

So, I've started it. Good luck to me.

Hanson Schmidt-Cornelius

Hi Ivan,

sure you can do it.

Kind Regards,

Hanson

Pius

Fingers crossed. I have just started my journey to app development and believing livecode to be my guide.

Karen Montes

very easy!!!!

coool

coool

Ron Burgendi

Hi Pius, crossing your fingers is bad for your health. You don't wanna start your journey without any fingers.

Willie Fritz

Thanks, I've just installed LiveCode and finding it remarkably easy and user-friendly!

Paxton

Why does it tal ten minutes for me to see the preview of my app? I unstall and reinstall the program many time to no avail. if this is how long it takes to do a simple preview is would take centuries to finish one app. Thanks

Hanson Schmidt-Cornelius

Hi Paxton,

it should not take very long at all to preview your application.

As soon as you are in Run Mode, your application is ready to go for testing. If it took one second for "Hello Word" to switch to run mode, then that would be a long time.

I am wondering if something is not set up properly.

Kind Regards,

Hanson

Bill

Just installed on my new iMac 27. LiveCode is exactly what I've been looking for. Really impressed!! thanks a ton....

Bill

Wes Haque

Hi. I just wanted to say, I'm in love with your distribution model. The fact that we can have awesome software like LiveCode for free, is just wonderful! The condition that we have to provide the source code openly under that model is actually an awesome bonus and only adds to the continued support of the language. So thank you for such a revolutionary gift. Hats off to you guys :)

Jack

Is the course doable online only? I'm trying to find a pdf that I can download and then learn when I'm offline. I can't be on internet all the time.

Elanor Buchanan

Hi Jack

Each lesson has a link to Download Lesson PDF in the bar on the left hand side.

I hope that helps.

Kind regards

Elanor

David Wong

I just follow the step to write hello world, and I save it call helloworld.livecode under the type livecode stack.
but my question is why the windows that show the button is still Untitlle 1*, do I need to find a way to save this too. And how can I make it become the exe in windows.
thanks.

Alejandro Tejada

Hi David,

Change the window title using the Stack Inspector
(Menu Object>Stack Inspector)

After opening the Stack Inspector (Basic Properties) change:
1) Name (This is the stack filename in your disk)
2) Title (The Stack Title, or "label") http://docs.runrev.com/Property/label
and Save the Stack.

This lesson explains how to create a Windows Executable or Standalone Application:
http://lessons.runrev.com/s/3527/m/4603/l/44282-building-standalone-applications
More detailed:
http://revolution.byu.edu/standalone/Distribution.php

Said Mohammad

I am starting off on the wrong foot here. I don't have all those features in my tools box. I only have two arrows, nothing else to choose from. What should I do?

Elanor Buchanan

Hi

What version of LiveCode do you have installed, is it version 8.0? LiveCode 8.0 is still in an early testing release, I would suggest you download the most up to date stable version, which is currently LiveCode 7.0.5 from

http://downloads.livecode.com/livecode/

If that doesn't help please email [email protected] and we will look into it.

Kind regards

Elanor

Bon

Hi Said,

I faced the same issue with you. First it was only two arrows appeared on the Toolbox.
I just exit and re-opened and all tools displayed.

Thanks

khadijah

hi there! i'm new in livecode. i try to save my work but it didn't work. how to save? which folder/location should i go? is there any application/software that i need to install ? im using linux 32 bit version, ubuntu 14.04, LiveCode community version 8.1.1.. i try to learn to develop for linux and android. thankyou.

Walt

why "ANSWER" and not "DISPLAY" or "POPUP"

Elanor Buchanan

Hi Walt

It's a historical term going back to Hypercard

http://web.csulb.edu/~murdock/hcindex.html

I think it probably comes from the fact that the user has to provide an 'answer' before the dialog is closed, but I'm not sure about that.

Elanor

ManuHernz

Really useful, user friendly and fast to see results. No emulator needed. I think I'm gonna do great with Livecode.
Greetings from Ecuador!
Very many thanks!

Caidyn Carlsson

wow

Terrence-Monroe:

mouseUp seems like a very unusual name for this event. First, it does not specify which button is pressed (right, middle, left) . Second, it does not address the mouse down event.

eury

live code its so cool

Vijay

I see a lot of similarities with Macromedia Director or Adobe Director. Starting from the interface, to the toolbox to even the code handlers (mouseUp). I am interested...Director was way ahead of its time and sadly it got boxed....

Anije

I've never coded before; am anxiously looking forward to finding out if I can learn this. Gonna give it a good try!

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.