update fn.test example code to see the difference between params and srcVariable.params

This commit is contained in:
pmario 2024-05-06 17:16:59 +02:00
parent a895787851
commit e4b832d37d
2 changed files with 8 additions and 9 deletions

View File

@ -1,5 +1,5 @@
created: 20240506132850677
modified: 20240506150652759
modified: 20240506151551620
tags: [[Operator Examples]] [[jsonvariable Operator]]
title: jsonvariable Operator (Examples)
type: text/vnd.tiddlywiki
@ -7,7 +7,7 @@ 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
\function fn.test(splitChar:" ") [enlist<testProc>format:titlelist[]]
\function fn.test(splitChar:" " not-used) [enlist<testProc>format:titlelist[]]
<pre><code><$text text={{{[[fn.test]jsonvariable[]]}}}/></code></pre>
""">>
@ -15,7 +15,7 @@ The following example shows the "internal" structure of the `fn.test` function d
The following example shows the same structure ''pretty printed'' using the <<.olink format>> filter operator
<<.example 2 """\procedure testProc() [[aa aa]] bb
\function fn.test(splitChar:" ") [enlist<testProc>format:titlelist[]]
\function fn.test(splitChar:" " not-used) [enlist<testProc>format:titlelist[]]
\function tab() [charcode[9]]
@ -25,7 +25,7 @@ The following example shows the same structure ''pretty printed'' using the <<.o
The following example extracts the ''function definition'' using the <<.olink jsonextract>> filter operator
<<.example 3 """\procedure testProc() [[aa aa]] bb
\function fn.test(splitChar:" ") [enlist<testProc>format:titlelist[]]
\function fn.test(splitChar:" " not-used) [enlist<testProc>format:titlelist[]]
<pre><code><$text text={{{[[fn.test]jsonvariable[]jsonextract[srcVariable],[value]]}}}/></code></pre>
""">>
@ -33,10 +33,9 @@ The following example extracts the ''function definition'' using the <<.olink js
The following example extracts the `srcVariables.params` without pretty printing using <<.olink jsonextract>>
<<.example 4 """\procedure testProc() [[aa aa]] bb
\function fn.test(splitChar:" ") [enlist<testProc>format:titlelist[]]
\function fn.test(splitChar:" " not-used) [enlist<testProc>format:titlelist[]]
\function tab() [charcode[9]]
<pre><code><$text text={{{[[fn.test]jsonvariable[]jsonextract[srcVariable],[params]format:json<tab>]}}}/></code></pre>""">>

View File

@ -1,6 +1,6 @@
caption: jsonvariable
created: 20240506131935424
modified: 20240506145944709
modified: 20240506151517068
op-input: a selection variable names
op-output: the JSON string values of each of the retrieved properties
op-parameter: one or more indexes of the property to retrieve
@ -11,7 +11,7 @@ title: jsonvariable Operator
type: text/vnd.tiddlywiki
\procedure testProc() [[aa aa]] bb
\function fn.test(splitChar:" ") [enlist<testProc>format:titlelist[]]
\function fn.test(splitChar:" " not-used) [enlist<testProc>format:titlelist[]]
\function tab() [charcode[9]]
<<.from-version "5.3.4">>
@ -22,7 +22,7 @@ Properties within a JSON object are identified by a sequence of indexes. In the
```
\procedure testProc() [[aa aa]] bb
\function fn.test(splitChar:" ") [enlist<testProc>format:titlelist[]]
\function fn.test(splitChar:" " not-used) [enlist<testProc>format:titlelist[]]
\function tab() [charcode[9]]