InfiniteScript Documentation
Welcome to the InfiniteScript documentation. InfiniteScript is a readable programming language designed around a unified runtime and ecosystem.
This documentation describes the current InfiniteScript architecture and implemented v0.2.0 language features.
Installation
InfiniteScript currently runs through the native
Inf.exe runtime on Windows.
After downloading the project, open a terminal in the project directory and run the InfiniteScript executable.
Inf.exe version
Your First Program
Create a file ending in .infs.
For example, create Hello.infs.
/- My first InfiniteScript program Say "Hello World!"
The Say command writes text to the program output.
Running InfiniteScript
Inf.exe run Hello.infs
You can also validate a program without running it:
Inf.exe check Hello.infs
Syntax
InfiniteScript uses readable command-based syntax.
Blocks are closed using End.
If Money > 100 Say "Rich!" Else Say "Keep working." End
Comments
Comments begin with /-.
/- This is a comment Say "Hello"
Variables
Variables can be created using Local Storage.
Local Storage Money = 100 Local Storage PlayerName = "Adan" Local Storage IsAdmin = true
Types
| Type | Example |
|---|---|
| Number | 100 |
| String | "Hello" |
| Boolean | true / false |
Expressions
InfiniteScript supports arithmetic and comparisons.
Set Money = Money + 50 If Money >= 100 Say "Enough." End
If Statements
If Money > 100 Say "Over 100" Else If Money == 100 Say "Exactly 100" Else Say "Under 100" End
Logical conditions can use And and
Or.
Loops
InfiniteScript supports While and For blocks.
While Money < 500 Change Money by 100 End
Break & Continue
Use Break to leave a loop and
Continue to skip to the next iteration.
Functions
Functions allow reusable blocks of code.
Local Function GiveMoney Change Money by 100 End GiveMoney
Parameters
Function GiveMoney Amount Change Money by Amount End GiveMoney 50
Return Values
Function GiveMoney Amount Change Money by Amount Return Money End
Say
Say "Hello World"
Set
Set Money = 500
Change
Change Money by 100
Input
Input PlayerName Input Number Age Input Boolean IsAdmin
Random
Random Number Roll = 1 to 6
Local Storage
Local Storage Money = 100 Local Storage PlayerName = "Adan"
Infinite UI
Infinite UI allows InfiniteScript programs to describe native interfaces. The native runtime renders the interface directly on Windows.
UI Window Main Title "My App" Size 800, 600 End End
Window
Window Main Title "My Application" End
Title
Title "InfiniteScript"
Size
Size 800, 600
Text
Text HeroTitle Content "Hello!" End
Button
Button GetStarted Text "Get Started" End
Events
UI events can be attached to elements.
Button GetStarted Text "Get Started" On Click Say "Button clicked!" End End
This documentation website is hosted as static HTML.
It does not execute Infinite UI. Native Infinite UI runs through
Inf.exe on Windows.