fn: console.lock



The syntax for console.lock calls is:




The console.lock function is for preventing other threads from outputting to the console, it takes zero parameters.

If the console is locked without being unlocked then it will be automatically unlocked and an error will be thrown with your file failing to build or script failing.

Note: If a thread building another page attempts to output to the console while it is locked the thread will stall until the console becomes available again, which can slow down build times.

Note: Nift will skip to the first non-whitespace (ie. to the first character that is not a space, tab or newline) after a console.lock call and inject it to the output file where the call started. If you want to prevent Nift from doing this put a '!' after the call, eg.:


f++ example

Example of console.lock being used with f++:

console("hello, world!")

n++ example

Example of console.lock being used with n++:

@console("hello, world!")