Inline code

Purpose: Inline Gliimly code in an output statement.

 <<gliim code>>

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

The following statements can be inlined: p-path,p-out, p-web, p-url, pf-out, pf-web, pf-url, p-num, current-row, number-string, string-length, sub-handler.
Examples
p-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 <<p-out  firstName>>
    @    </td>
    @    <td>
    @        Last name is <<p-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 <<sub-handler "/some-req">>

sub-handler "some-req" would simply output "world":
 %% /some-req
     @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 <<p-out mins>> minutes left!
 ))

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


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