Inline code

Purpose: Inline Golf code in an output statement.

<<golf code>>

You can write Golf statements within an output-statement by using them between << and >> delimiters.

The following statements can be inlined: print-out,print-format, current-row, number-string, string-length, call-handler.
Examples
print-out statement displays a string, and in the following code it's used to display a result within an output-statement (i.e. within "@" statement):
run-query ="select firstName, lastName from people" output firstName, lastName
   @<tr>
   @    <td>
   @        First name is <<print-out  firstName>>
   @    </td>
   @    <td>
   @        Last name is <<print-out lastName>>
   @    </td>
   @</tr>
end-query

In the code below, "some_req" is a request handler that outputs some text, and it's used inline to output "Hello world":
@Hello <<call-handler "/some-req">>

call-handler "some-req" would simply output "world":
%% /some-req public
    @world
%%

A write-string is typically used with output statements; in this case we print the value of another string, resulting in "There is 42 minutes left!":
set-string mins="42"
(( my_string
@There is <<print-out mins>> minutes left!
))

See also
Language
inline-code  
statements  
syntax-highlighting  
unused-var  
variable-scope  
See all
documentation


Copyright (c) 2019-2025 Gliim LLC. All contents on this web site is "AS IS" without warranties or guarantees of any kind.