API Expand.PathName: Difference between revisions
Appearance
XML import API changes |
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead"" |
||
| (10 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
{| class="mtx-class-macrotable wikitable" | |||
Expands a string using the built-in pathname expansion variables | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''PathName''' | |||
|- | |||
| colspan="2" | Expands a string using the built-in pathname expansion variables | |||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | |||
| width="90%" | Source | |||
|- | |||
| colspan="2" | The text to expand | |||
|- | |||
| 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'' | |||
|} | |||
== | ==Detailed description== | ||
[[ | This does not resolve a pathname, for this use [[API File.AbsPath|File.AbsPath]]. What this will do is use the ''$(variable)'' syntax to expand the string using built-in variable names used in the compiler settings and other pathname fields in Flowcode. | ||
== | The list of variables available in this expansion are: | ||
'' | {| class="wikitable" | ||
|- | |||
!width="25%"|Variable | |||
!Meaning | |||
|- | |||
|appdir | |||
|The Flowcode applications directory | |||
|- | |||
|chip | |||
|The name of the target chip, eg 16F88 | |||
|- | |||
|family | |||
|The family of the target chip, eg 16F | |||
|- | |||
|platform | |||
|The platform of the target chip, eg PIC | |||
|- | |||
|chippath | |||
|The full name of the target chip, eg PIC.16F.16F88 | |||
|- | |||
|chipalt | |||
|The alternate-name of the target chip | |||
|- | |||
|cfga | |||
|The address of the base of the config, as specified in the FCD file | |||
|- | |||
|cfgb | |||
|The number of bytes of the config specified in the FCD file | |||
|- | |||
|cfgen | |||
|Whether the user has selected to write config to the chip | |||
|- | |||
|cfg''N'' | |||
|Starting with ''cfg0'', the slot values specified in the config | |||
|- | |||
|target | |||
|The source or target file leafname, without an extension, eg ''my_project'' | |||
|- | |||
|srcdir | |||
|The directory the my-project.fcf file is located in | |||
|- | |||
|outdir | |||
|The directory output and intermediate files are sent to | |||
|} | |||
| Line 28: | Line 72: | ||
* Declare a variable 'result' of type STRING | * Declare a variable 'result' of type STRING | ||
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Expand.PathName("source")</pre> | * Add to a calculation icon: <pre class="brush:[cpp]">result = ::Expand.PathName("source")</pre> | ||
Latest revision as of 14:11, 13 July 2026
| PathName | |
| Expands a string using the built-in pathname expansion variables | |
| Source | |
| The text to expand | |
| Return | |
Detailed description
This does not resolve a pathname, for this use File.AbsPath. What this will do is use the $(variable) syntax to expand the string using built-in variable names used in the compiler settings and other pathname fields in Flowcode.
The list of variables available in this expansion are:
| Variable | Meaning |
|---|---|
| appdir | The Flowcode applications directory |
| chip | The name of the target chip, eg 16F88 |
| family | The family of the target chip, eg 16F |
| platform | The platform of the target chip, eg PIC |
| chippath | The full name of the target chip, eg PIC.16F.16F88 |
| chipalt | The alternate-name of the target chip |
| cfga | The address of the base of the config, as specified in the FCD file |
| cfgb | The number of bytes of the config specified in the FCD file |
| cfgen | Whether the user has selected to write config to the chip |
| cfgN | Starting with cfg0, the slot values specified in the config |
| target | The source or target file leafname, without an extension, eg my_project |
| srcdir | The directory the my-project.fcf file is located in |
| outdir | The directory output and intermediate files are sent to |
Examples
Calling in a calculation
- Declare a variable 'result' of type STRING
- Add to a calculation icon:
result = ::Expand.PathName("source")