Jump to content

API Console.AddMemory: 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" | '''AddMemory'''
|-
| 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-u32-icon.png]] - ULONG
| width="90%" | Bytes
|-
| colspan="2" | The number of bytes to add to the buffer&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
| width="90%" | BpL
|-
| colspan="2" | The number of bytes per line to display&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Init
|-
| colspan="2" | The value to initialise each byte of memory to&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | UserWrite
|-
| colspan="2" | Set true to allow amending of the data 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 Console|Console]]
:[[API Console|AddMemory]]
</div>
__TOC__


==Parameters==
==Detailed description==
''[[Variable types|STRING]] Name''
A memory console is a block of text suitable for use as a memory display, for example to display the contents of a disk or EEPROM. When text is added, this will always overwrite the existing memory so the text contents will remain the same size. This differs from the [[API Console.AddText|AddText]] call which has an unlimited size and operates in 'append' mode to add to the text.
:The name to appear as the consoles title


''[[Variable types|ULONG]] Bytes''
:The number of bytes to add to the buffer


''[[Variable types|ULONG]] BpL''
Once a handle is created it must be retained, as Flowcode will remove any handles from the system that are not referenced.
:The number of bytes per line to display
:''The default value for this parameter is: '''''16'''


''[[Variable types|BYTE]] Init''
:The value to initialise each byte of memory to
:''The default value for this parameter is: '''''0'''


''[[Variable types|BOOL]] UserWrite''
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 memory console always has a fixed size and a fixed number of characters per line.
:Set true to allow amending of the data from the User


==Return value==
[[Variable types|HANDLE]]
No additional information
==Detailed description==
''No additional information''


==Examples==
==Examples==
Line 38: Line 51:
* 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.AddMemory("name", bytes, bpl, init, false)</pre>
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Console.AddMemory("name", bytes, bpl, init, false)</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

AddMemory
Adds a window to the list of consoles available 
- STRING Name
The name to appear as the consoles title 
- ULONG Bytes
The number of bytes to add to the buffer 
- ULONG BpL
The number of bytes per line to display 
- BYTE Init
The value to initialise each byte of memory to 
- BOOL UserWrite
Set true to allow amending of the data from the User 
- HANDLE Return


Detailed description

A memory console is a block of text suitable for use as a memory display, for example to display the contents of a disk or EEPROM. When text is added, this will always overwrite the existing memory so the text contents will remain the same size. This differs from the AddText call which has an unlimited size and operates in 'append' mode to add to 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 memory console always has a fixed size and a fixed number of characters per line.


Examples

Calling in a calculation

  • Declare a variable 'result' of type HANDLE
  • Add to a calculation icon:
    result = ::Console.AddMemory("name", bytes, bpl, init, false)

Flowchart example

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