Difference between revisions of "API Console.AddMemory"

From Flowcode Help
Jump to navigationJump to search
(XML import)
(XML import)
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<sidebar>API contents</sidebar>
+
<sidebar>API Contents</sidebar>
 
Adds a window to the list of consoles available
 
Adds a window to the list of consoles available
  
 
<div style="width:25%; float:right" class="toc">
 
<div style="width:25%; float:right" class="toc">
===Class hierarchy===
+
====Class hierarchy====
:Console
+
[[API Console|Console]]
::AddMemory
+
:[[API Console|AddMemory]]
 
</div>
 
</div>
 
__TOC__
 
__TOC__
  
 
==Parameters==
 
==Parameters==
''[[Variable types|STRING]] Name''
+
[[Variable Types|STRING]] ''Name''
 
:The name to appear as the consoles title
 
:The name to appear as the consoles title
  
''[[Variable types|ULONG]] Bytes''
+
[[Variable Types|ULONG]] ''Bytes''
 
:The number of bytes to add to the buffer
 
:The number of bytes to add to the buffer
  
''[[Variable types|ULONG]] BpL''
+
[[Variable Types|ULONG]] ''BpL''
 
:The number of bytes per line to display
 
:The number of bytes per line to display
 
:''The default value for this parameter is: '''''16'''
 
:''The default value for this parameter is: '''''16'''
  
''[[Variable types|BYTE]] Init''
+
[[Variable Types|BYTE]] ''Init''
 
:The value to initialise each byte of memory to
 
:The value to initialise each byte of memory to
 
:''The default value for this parameter is: '''''0'''
 
:''The default value for this parameter is: '''''0'''
  
''[[Variable types|BOOL]] UserWrite''
+
[[Variable Types|BOOL]] ''UserWrite''
 
:Set true to allow amending of the data from the User
 
:Set true to allow amending of the data from the User
 +
  
 
==Return value==
 
==Return value==
[[Variable types|HANDLE]]
+
[[Variable Types|HANDLE]]
 +
 
 +
A handle to the memory console that can be used to change its style and content.
  
No additional information
 
  
 
==Detailed description==
 
==Detailed description==
''No additional information''
+
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.
 +
 
 +
 
 +
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==
 
==Examples==
Line 39: Line 48:
 
* 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 15:57, 16 January 2014

<sidebar>API Contents</sidebar> Adds a window to the list of consoles available

Class hierarchy

Console

AddMemory

Parameters

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
The default value for this parameter is: 16

BYTE Init

The value to initialise each byte of memory to
The default value for this parameter is: 0

BOOL UserWrite

Set true to allow amending of the data from the User


Return value

HANDLE

A handle to the memory console that can be used to change its style and content.


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 FC6 Icon.png SIMAPI Console illustrates basic creation of a console window.