Difference between revisions of "API Expand.VarName"

From Flowcode Help
Jump to navigationJump to search
(XML import of updated Expand.VarName)
Line 1: Line 1:
 
  
 
<sidebar>API contents</sidebar>
 
<sidebar>API contents</sidebar>
Line 21: Line 20:
 
[[Variable Types|BOOL]] ''SizeName''
 
[[Variable Types|BOOL]] ''SizeName''
 
:Set true to return the expanded size define
 
:Set true to return the expanded size define
 +
 +
[[Variable Types|BOOL]] ''FullLine''
 +
:Set true to expand to a full declaration, else just the name
  
  
Line 39: Line 41:
 
===Calling in a calculation===
 
===Calling in a calculation===
 
* 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.VarName("source", owner, false)</pre>
+
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Expand.VarName("source", owner, false, true)</pre>
  
 
''<span style="color:red;">No additional examples</span>''
 
''<span style="color:red;">No additional examples</span>''

Revision as of 18:03, 17 June 2013

<sidebar>API contents</sidebar> Expands a string to the name of a global variable used in the generated code

Class hierarchy

Expand

VarName

Parameters

STRING Source

The variable name to expand

HANDLE Owner

A component that owns the variable
The default value for this parameter is: this

BOOL SizeName

Set true to return the expanded size define

BOOL FullLine

Set true to expand to a full declaration, else just the name


Return value

STRING

The global variable name as it would exist in the generated code


Detailed description

This expands a global variable to the name it would be given in the generated code. The size define (the size of the final dimension of the array) may be returned instead if required.


Note this does not return the full expression unless FullLine is true. In this case, Source must be a valid variable name for the Owner component, as the system needs this in order to expand the variable type, array sizes and initialisers.


Examples

Calling in a calculation

  • Declare a variable 'result' of type STRING
  • Add to a calculation icon:
    result = ::Expand.VarName("source", owner, false, true)

No additional examples