01 — Hello World
InfiniteScript programs use the .infs file extension. The simplest program can print text using Say.
Say "Hello World!"
Save the file and run it with:
.\Inf.exe run Hello.infs
02 — Values
InfiniteScript supports several basic values.
Words and sentences.
Whole numbers and decimals.
True or false.
03 — Variables
Variables let your program remember information. InfiniteScript uses readable storage syntax.
Local Storage Money = 100 Local Storage PlayerName = "Adan" Local Storage IsAdmin = true
You can change a stored value:
Change Money by 50
04 — Conditions
Conditions allow your program to make decisions.
If Money > 100 Say "You have lots of money." Else Say "You need more money." End
05 — Loops
A loop repeats code.
For i = 1 to 5 Say i End
This runs the body five times.
06 — Functions
Functions allow you to package reusable behaviour.
Function GiveMoney Amount Change Money by Amount Return Money End GiveMoney 50
07 — Input
Ask the user for information with Input.
Input PlayerName Say PlayerName
You can also specify the expected type.
Input Number Age Input Boolean IsAdmin
08 — Random Numbers
Random can generate a number within a range.
Random Number Roll = 1 to 6 Say Roll
09 — Your First Infinite UI
InfiniteScript can define native Windows interfaces using Infinite UI.
UI Window Main Title "My First App" Text Welcome Content "Hello!" End Button Start Text "Get Started" On Click Say "Welcome!" End End End End