9xc Language - Owen2k6/GoOS GitHub Wiki

Language & Basics

Lines, comments, trimming

  • Each line is trimmed and literal \n in the source is converted to a newline.
  • Empty lines are ignored.
  • Comments start with ; and continue to end‑of‑line.
  • Trailing semicolons in a line are stripped (everything after ; is dropped).

Imports

import *         ; all libraries
import System
import Console
import IO
import Time
import 9xGL
import GoOS

Unknown libraries raise an error.

Equality blocks

A minimal if/endif form exists:

if (Var = "text")
    ; lines...
endif

if (Num = 10)
    ; lines...
endif

if (Flag = true)
    ; lines...
endif

Negation:

if (Var ! "value")
    ; lines...
endif
  • The interpreter searches for the matching endif and skips the block when the comparison fails.
  • The left operand must be an existing Int, String, or Bool variable.
  • The right operand is parsed according to the left side’s type (quoted string for String, plain for Int, true|false for Bool).

Variables

Boolean

Bool Flag
Bool Flag = true
  • Special key Cursor requires the Console library and sets Console.CursorVisible.

Integer

Int Score
Int Score = 42
Int Score++
Int Score--
Int Hex = 0xFF
Int NowS = Seconds   ; Time lib
Int NowM = Minutes   ; Time lib
Int NowH = Hours     ; Time lib
  • Setting CursorX / CursorY updates the console cursor (Console lib).

String

String Name
String Name = "Owen"
String Key = ReadLine        ; Console lib
String Ch  = Read            ; Console lib (single key)
String Txt = ReadFile >> "0:\\path.txt"   ; IO lib

Color (console colour)

Color ForeColor = Yellow     ; Console lib (sets foreground)
Color BackColor = DarkBlue   ; Console lib (sets background)
Color Accent = Magenta       ; user variable (no side‑effect)

Accepted tokens match the interpreter’s table: White, Blue, Green, Yellow, Black, Cyan, Gray, Magenta, Red, DarkBlue, DarkCyan, DarkGray, DarkGreen, DarkMagenta, DarkRed, DarkYellow.

⚠️ **GitHub.com Fallback** ⚠️