Jump to content

Component: JSON Decoder ( Comms): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "class="wikitable" style="width:60%; background-color:#FFFFFF;"" to "class="mtx-class-macrotable wikitable""
Line 38: Line 38:


===FindName===
===FindName===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 62: Line 62:


===ParseJSON===
===ParseJSON===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 81: Line 81:


===ReadDataAsFloat===
===ReadDataAsFloat===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 100: Line 100:


===ReadDataAsNumber===
===ReadDataAsNumber===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 119: Line 119:


===ReadDataAsString===
===ReadDataAsString===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 138: Line 138:


===ReadName===
===ReadName===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 158: Line 158:
==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]

Revision as of 14:15, 13 July 2026

Author
Version 0.1
Category Comms


JSON Decoder component

Allows dynamic key and value pairs to be collected from a formatted JSON string.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_WEBEXP_JSONDecoder.fcsx

Please click here to view the component source code (Beta): FC_Comp_Source_WEBEXP_JSONDecoder.fcsx

Detailed description

No detailed description exists yet for this component

Examples

Simple Data

Example program showing how to use a JSON decoder component to parse a simple JSON encoded data string.

Web JSON Decoder Example


Macro reference

FindName

FindName
Searches for a name in the JSON data. Returns the data index position. Returns -1 if the name was not found.  
- STRING Name
Name of the data key to find 
- LONG SkipCount
Number of matches to skip before returning. 
- INT Return


ParseJSON

ParseJSON
Converts JSON formatted string to a JavaScript object. Compatible with FindName, ReadName and ReadDataAs functions. Returns the number of key/data pairs. 
- STRING sText
JSON string data to parse 
- ULONG Return


ReadDataAsFloat

ReadDataAsFloat
Reads the data of a specific element as a floating point value  
- LONG Element
Index of the element to read 
- FLOAT Return


ReadDataAsNumber

ReadDataAsNumber
Reads the data of a specific element as a numeric value  
- LONG Element
Index of the element to read 
- ULONG Return


ReadDataAsString

ReadDataAsString
Reads the data of a specific element as a string value  
- LONG Element
Index of the element to read 
- STRING Return


ReadName

ReadName
Reads the name of a specific element 
- LONG Element
The Index of the element to read 
- STRING Return


Property reference

Properties
JSON Reviver macro
Allows an easy way for you to parse incoming JSON data element by element.