Component: JSON Decoder ( Comms): Difference between revisions
Appearance
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;" align="center"" to "width="10%" align="center" class="mtx-class-macrohead"" |
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead"" |
||
| (One intermediate revision by the same user not shown) | |||
| Line 41: | Line 41: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''FindName''' | ||
|- | |- | ||
| colspan="2" | Searches for a name in the JSON data. Returns the data index position. Returns -1 if the name was not found. | | colspan="2" | Searches for a name in the JSON data. Returns the data index position. Returns -1 if the name was not found. | ||
| Line 65: | Line 65: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ParseJSON''' | ||
|- | |- | ||
| colspan="2" | Converts JSON formatted string to a JavaScript object. Compatible with FindName, ReadName and ReadDataAs functions. Returns the number of key/data pairs. | | colspan="2" | Converts JSON formatted string to a JavaScript object. Compatible with FindName, ReadName and ReadDataAs functions. Returns the number of key/data pairs. | ||
| Line 84: | Line 84: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadDataAsFloat''' | ||
|- | |- | ||
| colspan="2" | Reads the data of a specific element as a floating point value | | colspan="2" | Reads the data of a specific element as a floating point value | ||
| Line 103: | Line 103: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadDataAsNumber''' | ||
|- | |- | ||
| colspan="2" | Reads the data of a specific element as a numeric value | | colspan="2" | Reads the data of a specific element as a numeric value | ||
| Line 122: | Line 122: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadDataAsString''' | ||
|- | |- | ||
| colspan="2" | Reads the data of a specific element as a string value | | colspan="2" | Reads the data of a specific element as a string value | ||
| Line 141: | Line 141: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadName''' | ||
|- | |- | ||
| colspan="2" | Reads the name of a specific element | | colspan="2" | Reads the name of a specific element | ||
| Line 160: | Line 160: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
Latest revision as of 14:23, 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.
Macro reference
FindName
ParseJSON
ReadDataAsFloat
| ReadDataAsFloat | |
| Reads the data of a specific element as a floating point value | |
| Element | |
| Index of the element to read | |
| Return | |
ReadDataAsNumber
| ReadDataAsNumber | |
| Reads the data of a specific element as a numeric value | |
| Element | |
| Index of the element to read | |
| Return | |
ReadDataAsString
| ReadDataAsString | |
| Reads the data of a specific element as a string value | |
| Element | |
| Index of the element to read | |
| Return | |
ReadName
| ReadName | |
| Reads the name of a specific element | |
| Element | |
| The Index of the element to read | |
| Return | |
Property reference
| Properties | |
| JSON Reviver macro | |
| Allows an easy way for you to parse incoming JSON data element by element. | |