[start]
The [start]
block is the default entry point for your Rhyme app. When your app launches, it automatically begins executing from this block.
Purpose
The [start]
block is where your app begins its journey. Think of it as the front door to your app - the first thing users see and interact with.
Basic Example
[start]
.title "Welcome to My App"
.text "Let's get started!"
.button "Begin" [main-menu]
Common Patterns
Welcome Screen
[start]
.image "logo.png"
.title "Task Manager"
.text "Organize your day"
.button "Sign In" [login]
.button "Sign Up" [register]
Direct Navigation
[start]
// Check if user is already logged in
if $user-token
goto [dashboard]
else
goto [welcome]
end
Initial Setup
[start]
.title "Setting up..."
// Load user preferences
call [load-settings]
// Navigate to appropriate screen
goto [home]
Best Practices
- Keep the
[start]
block simple and focused - Use it to welcome users or check initial conditions
- Consider it your app’s first impression
- Avoid heavy processing - use
[init]
for setup tasks
What Happens Without [start]?
If your app doesn’t have a [start]
block, Rhyme will look for the first block defined in your code and use that as the entry point.