← Documentation Home

1) First Launch and First Run

Back to Getting Started


Your First Goal

In this section, your only goal is to run a small program and confirm the IDE, compiler, and runtime are working.

Create a New Source File

  • Create or open a file with the .lb extension.
  • Save it in your project folder with a clear name, such as first-run.lb.

Paste This Program

SetAppTitle("First Run")
Graphics(800, 600, False)
SetClsColor(18, 24, 34)

Dim running As Boolean
Dim fontRef As Integer

fontRef = LoadFont("", 20)
running = True

Do
    Cls()
    DrawText(fontRef, 20, 20, "LunarBasic is running.")
    DrawText(fontRef, 20, 52, "Press ESC to close.")
    Flip()

    If KeyHit(KEY_ESC) Then
        running = False
    End If
Loop Until Not running

FreeFont(fontRef)

Run It

  • Use the IDE run action.
  • A window should open and show the two text lines.
  • Press ESC to exit.

If Something Fails

  • Check the Messages panel first. The first error is usually the real cause.
  • Confirm your file extension is .lb.
  • Confirm the file has been saved before running.

Navigation: Outline | Next: Complete IDE Guide