Glich - v0.3.0 Manual
Define command & call Statement
Development v0.3.0 Manual Glich Script Statements command & call

Statements: command, call

A command statement is similar to a function definition except it does not return a result and can only be instigated with a call statement. Optionally, arguments can be passed to the command which can then be used as local variables. When calling the command, these augments may be given values or omitted. An argument can be given a default value when the command is defined.

Statement command Format
command name { statements ... } call name;
command name(arg=value, arg=value) { statements ... } call name(value1, value2);
Statement command Format
ExampleOutput
command wr_today { write string.g:dmy today; } ... call wr_today; 21 May 2017
Written when today = "g:dmy# 21 May 2017"
object complex { values real imaginary; } command write_complex( c ) { if v[.object] = complex if c[imaginary] < 0 write c[real] + " - " + c[imaginary] + "i"; elseif c[imaginary] = 0 write c[real]; else write c[real] + " + " + c[imaginary] + "i"; endif endif } call write_complex( {complex 20, -25} ); 20 - 25i
Development v0.3.0 Manual Glich Script Statements command & call

Managed by WebPageLayout Validated by HTML Validator (based on Tidy)

9th March 2023