Input/output

procedure print(value: Any)
Outputs the given value to the console.
function input(query: String) -> String
Requests input from the user, causing the rest of the program to pause while the user is responding. Use the enter key to submit input.
procedure clear()warning
Clears the console, removing all past log messages, warnings and input prompts.
Note: This feature is not strictly part of the J277 specification. Using it will display a warning (which can be disabled in settings).

Type conversion

function int(value: Any) -> Integer
Casts the given value to an Integer.
function real(value: Any) -> Real
Casts the given value to a Real.
function float(value: Any) -> Real
Casts the given value to a Real (same as real(value)).
function str(value: Any) -> String
Casts the given value to a String.

Number manipulation

function sqrt(value: Number) -> Real
Finds the positive square root of the given number (e.g. sqrt(0.25) == 0.5)
function floor(value: Number) -> Integer
Rounds the number down to an integer (e.g. floor(0.9) == 0)
function ceil(value: Number) -> Integer
Rounds the number up to an integer (e.g. ceil(0.1) == 0)
function round(value: Number) -> Integer
Rounds the number to the nearest integer (e.g. round(0.5) == 1)
function random(from: Number, to: Number) -> Number
Picks a random number between from and to inclusive. If both parameters are Integers, an Integer is returned, otherwise a Real is returned.

File manipulation

procedure newFile(filename: String)
Creates a file with the name filename. If the file already exists, an error will occur
function existsFile(filename: String) -> Booleanwarning
Returns true if the file exists, otherwise false
Note: This feature is not strictly part of the J277 specification. Using it will display a warning (which can be disabled in settings).
procedure delFile(filename: String)warning
Deletes the specified file immediately. Any attempt to read/write from File objects referencing this file will give a broken handle error
Note: This feature is not strictly part of the J277 specification. Using it will display a warning (which can be disabled in settings).
function openRead(filename: String) -> File
Opens a the specified file in read-only mode.
function openWrite(filename: String) -> File
Opens a the specified file in write-only mode.
function open(filename: String) -> File
Opens a the specified file. When .readLine or .writeLine are called, the file handle changes into read-only or write-only mode respectively.

String manipulation

function ASC(char: String) -> Integer
Returns the ASCII value of the given character (e.g. ASC('A') == 65
function CHR(code: Integer) -> String
Returns the character represented by the given ASCII code (e.g. CHR(97) == 'a').

Miscellaneous

procedure wait(time: Number)warning
Waits for the specified duration in seconds.
Note: This feature is not strictly part of the J277 specification. Using it will display a warning (which can be disabled in settings).