2024-05-06 15:13:08 +00:00
|
|
|
created: 20240506132850677
|
2024-05-06 15:16:59 +00:00
|
|
|
modified: 20240506151551620
|
2024-05-06 15:13:08 +00:00
|
|
|
tags: [[Operator Examples]] [[jsonvariable Operator]]
|
|
|
|
title: jsonvariable Operator (Examples)
|
|
|
|
type: text/vnd.tiddlywiki
|
|
|
|
|
|
|
|
The following example shows the "internal" structure of the `fn.test` function defined in <<.olink jsonvariable>> operator
|
|
|
|
|
|
|
|
<<.example 1 """\procedure testProc() [[aa aa]] bb
|
2024-05-06 15:16:59 +00:00
|
|
|
\function fn.test(splitChar:" " not-used) [enlist<testProc>format:titlelist[]]
|
2024-05-06 15:13:08 +00:00
|
|
|
|
|
|
|
<pre><code><$text text={{{[[fn.test]jsonvariable[]]}}}/></code></pre>
|
|
|
|
""">>
|
|
|
|
|
|
|
|
The following example shows the same structure ''pretty printed'' using the <<.olink format>> filter operator
|
|
|
|
|
|
|
|
<<.example 2 """\procedure testProc() [[aa aa]] bb
|
2024-05-06 15:16:59 +00:00
|
|
|
\function fn.test(splitChar:" " not-used) [enlist<testProc>format:titlelist[]]
|
2024-05-06 15:13:08 +00:00
|
|
|
|
|
|
|
\function tab() [charcode[9]]
|
|
|
|
|
|
|
|
<pre><code><$text text={{{[[fn.test]jsonvariable[]format:json<tab>]}}}/></code></pre>
|
|
|
|
""">>
|
|
|
|
|
|
|
|
The following example extracts the ''function definition'' using the <<.olink jsonextract>> filter operator
|
|
|
|
|
|
|
|
<<.example 3 """\procedure testProc() [[aa aa]] bb
|
2024-05-06 15:16:59 +00:00
|
|
|
\function fn.test(splitChar:" " not-used) [enlist<testProc>format:titlelist[]]
|
2024-05-06 15:13:08 +00:00
|
|
|
|
|
|
|
<pre><code><$text text={{{[[fn.test]jsonvariable[]jsonextract[srcVariable],[value]]}}}/></code></pre>
|
|
|
|
""">>
|
|
|
|
|
|
|
|
The following example extracts the `srcVariables.params` without pretty printing using <<.olink jsonextract>>
|
|
|
|
|
|
|
|
<<.example 4 """\procedure testProc() [[aa aa]] bb
|
2024-05-06 15:16:59 +00:00
|
|
|
\function fn.test(splitChar:" " not-used) [enlist<testProc>format:titlelist[]]
|
2024-05-06 15:13:08 +00:00
|
|
|
|
|
|
|
\function tab() [charcode[9]]
|
|
|
|
|
|
|
|
<pre><code><$text text={{{[[fn.test]jsonvariable[]jsonextract[srcVariable],[params]format:json<tab>]}}}/></code></pre>""">>
|
|
|
|
|