Jump to content

API Console.AddText: Difference between revisions

From Flowcode Help
Admin (talk | contribs)
XML import
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
 
(15 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<sidebar>API contents</sidebar>
{| class="mtx-class-macrotable wikitable"
Adds a window to the list of consoles available
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''AddText'''
|-
| colspan="2" | Adds a window to the list of consoles available&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Name
|-
| colspan="2" | The name to appear as the consoles title&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | UserWrite
|-
| colspan="2" | Set true to allow input from the User&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-h32-icon.png]] - HANDLE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


<div style="width:25%; float:right" class="toc">
===Class hierarchy===[[API |API ]]
:[[API Console|Console]]
::AddText
</div>
__TOC__


==Parameters==
==Detailed description==
''[[Variable types|STRING]] Name''
A text console is a stream of text suitable for use as a terminal to display, for example RS232 data or a remote connection. When text is added, this is always appended to the end of the stream so the text contents will get larger. This differs from the [[API Console.AddMemory|AddMemory]] call which has a fixed size and operates in 'overwrite' mode to change the text.
:The name to appear as the consoles title


''[[Variable types|BOOL]] UserWrite''
:Set true to allow input from the User


==Return value==
Once a handle is created it must be retained, as Flowcode will remove any handles from the system that are not referenced.
[[Variable types|HANDLE]]
 
 
The style and content of the console can be changed at any time. The only thing that is fixed is the ''type'' of console - a text console always has a variable size and a variable number of characters per line.


No additional information


==Detailed description==
''No additional information''


==Examples==
==Examples==
Line 28: Line 37:
* Declare a variable 'result' of type HANDLE
* Declare a variable 'result' of type HANDLE
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Console.AddText("name", true)</pre>
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Console.AddText("name", true)</pre>
===Flowchart example===
The example {{Fcfile|SIMAPI Console.fcfx|SIMAPI Console}} illustrates basic creation of a console window.

Latest revision as of 14:11, 13 July 2026

AddText
Adds a window to the list of consoles available 
- STRING Name
The name to appear as the consoles title 
- BOOL UserWrite
Set true to allow input from the User 
- HANDLE Return


Detailed description

A text console is a stream of text suitable for use as a terminal to display, for example RS232 data or a remote connection. When text is added, this is always appended to the end of the stream so the text contents will get larger. This differs from the AddMemory call which has a fixed size and operates in 'overwrite' mode to change the text.


Once a handle is created it must be retained, as Flowcode will remove any handles from the system that are not referenced.


The style and content of the console can be changed at any time. The only thing that is fixed is the type of console - a text console always has a variable size and a variable number of characters per line.


Examples

Calling in a calculation

  • Declare a variable 'result' of type HANDLE
  • Add to a calculation icon:
    result = ::Console.AddText("name", true)

Flowchart example

The example SIMAPI Console illustrates basic creation of a console window.