File: hello.md

package info (click to toggle)
surgescript 0.5.4.4-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,876 kB
  • sloc: ansic: 13,674; makefile: 16
file content (19 lines) | stat: -rw-r--r-- 573 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Hello, World!
=============

SurgeScript creates automatically an object called **Application**. That object is defined by the user. Let's see how we can use that to make a simple program:

```
object "Application"
{
    state "main"
    {
        Console.print("Hello, world!");
        Application.exit();
    }
}
```

In SurgeScript, each object defines a state machine (more on that later). The initial state is called **main**. In the code just presented, we display a *Hello, world!* message and then exit the app.

Now let's [test your scripts](/tutorials/testing).