Special Values
Special values are compile-time tokens replaced with actual values during processing. They use the @ prefix followed by a keyword.
Only processed in .ss files, not in .gml files.
Expressions inside comments are not expanded (JSDoc comments are preserved).
Reference
Section titled “Reference”Current UTC datetime in ISO 8601 format, without double quotes.
Syntax
Section titled “Syntax”@nowExample
Section titled “Example”var current_datetime = "@now";Result
Section titled “Result”var current_datetime = "@now";var current_datetime = "2025-03-15T12:34:56Z";@today
Section titled “@today”Current UTC date only, without double quotes.
Syntax
Section titled “Syntax”@todayExample
Section titled “Example”var current_datetime = "@today";Result
Section titled “Result”var current_datetime = "@today";var current_datetime = "2025-03-15";@version
Section titled “@version”The version field from ScaffScript’s own package.json, without double quotes.
Syntax
Section titled “Syntax”@versionExample
Section titled “Example”var scaffscript_version = "@version";Result
Section titled “Result”var scaffscript_version = "@version";var scaffscript_version = "0.1.6";Name of the current file, without the .ss extension and without double quotes.
Syntax
Section titled “Syntax”@fileExample
Section titled “Example”var current_file = "@file";Result
Section titled “Result”var current_file = "@file";var current_file = "index";Line number (1-based) of the line where @line appears.
Syntax
Section titled “Syntax”@lineExample
Section titled “Example”// --- snip ---var current_line = @line;Result
Section titled “Result”// --- snip --- var current_line = @line; var current_line = 10;@counter
Section titled “@counter”Current counter value, then increments by 1. Starts at counterStart from config (default: 1). Counter is global across all files in a run.
Syntax
Section titled “Syntax”@counterExample
Section titled “Example”show_debug_message("Current count: " + "@counter");
var next_count = @counter;var multiply = 10 * @counter;Result
Section titled “Result”show_debug_message("Current count: " + "@counter");show_debug_message("Current count: " + "1");
var next_count = @counter;var multiply = 10 * @counter;var next_count = 2;var multiply = 10 * 3;Example
Section titled “Example”#[main]/** * ScaffScript Version: @version * Created at @today. * Line: @line. File: @file. Counter: @counter. */show_debug_message("hello");Output:
/** * ScaffScript Version: @version * Created at @today. * Line: @line. File: @file. Counter: @counter. * ScaffScript Version: 0.1.6 * Created at 2025-03-15. * Line: 4. File: "index". Counter: 1. */show_debug_message("hello");