Component: JSON Decoder ( Comms)

From Flowcode Help
Jump to navigationJump to search
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.

FC6 Icon.png Web JSON Decoder Example


Macro reference

FindName

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


ParseJSON

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


ReadDataAsFloat

Fc9-comp-macro.png ReadDataAsFloat
Reads the data of a specific element as a floating point value  
Fc9-s32-icon.png - LONG Element
Index of the element to read 
Fc9-f32-icon.png - FLOAT Return


ReadDataAsNumber

Fc9-comp-macro.png ReadDataAsNumber
Reads the data of a specific element as a numeric value  
Fc9-s32-icon.png - LONG Element
Index of the element to read 
Fc9-u32-icon.png - ULONG Return


ReadDataAsString

Fc9-comp-macro.png ReadDataAsString
Reads the data of a specific element as a string value  
Fc9-s32-icon.png - LONG Element
Index of the element to read 
Fc9-string-icon.png - STRING Return


ReadName

Fc9-comp-macro.png ReadName
Reads the name of a specific element 
Fc9-s32-icon.png - LONG Element
The Index of the element to read 
Fc9-string-icon.png - STRING Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-24-icon.png JSON Reviver macro
Allows an easy way for you to parse incoming JSON data element by element.