Jump to content

API FCD.GetItemValue: Difference between revisions

From Flowcode Help
JonnyW (talk | contribs)
XML import
No edit summary
Line 1: Line 1:
<sidebar>API Contents</sidebar>
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Gets a paths item value from the FCD document
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
<div style="width:25%; float:right" class="toc">
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetItemValue'''
====Class hierarchy====
|-
[[API FCD|FCD]]
| colspan="2" | Gets a paths item value from the FCD document&nbsp;
:[[API FCD|GetItemValue]]
|-
</div>
|-
__TOC__
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" | PathName
==Parameters==
|-
[[Variable Types|STRING]] ''PathName''
| colspan="2" | The '.' separated path through the FCD to look in&nbsp;
:The '.' separated path through the FCD to look in
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
[[Variable Types|STRING]] ''ItemName''
| width="90%" | ItemName
:The name of the item to read
|-
 
| colspan="2" | The name of the item to read&nbsp;
[[Variable Types|STRING]] ''DefText''
|-
:A default value to return if the item is not found
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
:''The default value for this parameter is: '''''""'''
| width="90%" | DefText
 
|-
 
| colspan="2" | A default value to return if the item is not found&nbsp;
==Return value==
|-
[[Variable Types|STRING]]
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
Returns the paths item value from the FCD document
|}





Revision as of 11:41, 16 January 2023

GetItemValue
Gets a paths item value from the FCD document 
- STRING PathName
The '.' separated path through the FCD to look in 
- STRING ItemName
The name of the item to read 
- STRING DefText
A default value to return if the item is not found 
- STRING Return


Detailed description

FCD files are XML files. The PathName must be a list of items, not including the XML root tag of the tags where the XML attribute ItemName is to be located. So to extract the FLASH memory size Pathname="device.memory" and ItemName="bytes".


If the ItemName is not found in the specified location then DefText will be returned instead.


Examples

Calling in a calculation

  • Declare a variable 'result' of type STRING
  • Add to a calculation icon:
    result = ::FCD.GetItemValue("pathname", "itemname", "deftext")

No additional examples