Difference between revisions of "API System.Notify"

From Flowcode Help
Jump to navigationJump to search
(XML Import to change Variable types into Variable Types)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<sidebar>API contents</sidebar>
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Sends a System.User message to the targeted component
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Notify'''
 +
|-
 +
| colspan="2" | Sends a System.User message to the targeted component&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
 +
| width="90%" | Target
 +
|-
 +
| colspan="2" | The component to send the message to&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
 +
| width="90%" | Ident
 +
|-
 +
| colspan="2" | A user-defined value for identification purposes&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | Some user-defined data to send to the target&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - NONE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
<div style="width:25%; float:right" class="toc">
 
====Class hierarchy====
 
[[API System|System]]
 
:[[API System|Notify]]
 
</div>
 
__TOC__
 
  
==Parameters==
+
==Detailed description==
[[Variable Types|HANDLE]] ''Target''
+
Notifications are posted between components using the event [[Event System.User|System.User]]. This is invoked by this '''Notify''' message. Here ''Target'' is the component to post the message to.
:The component to send the message to
+
 
 +
 
 +
''Ident'' and ''Data'' are user defined values - Flowcode does not put any constraints on what these are, but by convention ''Ident'' is specified by the recipient of the message in order to identify this from other [[Event System.User|System.User]] messages.
 +
 
  
[[Variable Types|ULONG]] ''Ident''
+
Note that as this message is post instead of sent, the ''Target'' may not receive the message immediately, and the caller should not wait for a reply inside an event macro.
:A user-defined value for identification purposes
 
:''The default value for this parameter is: '''''0'''
 
  
[[Variable Types|ULONG]] ''Data''
 
:Some user-defined data to send to the target
 
:''The default value for this parameter is: '''''0'''
 
  
 +
A typical timeline of events involving this message are:
 +
* Initialise called and ''Target'' calls a <tt>Register(''Ident'')</tt> function in the host
  
==Return value==
+
* An event (such as a mouse click) causes the state of the host to change
''This call does not return a value''
 
  
 +
* The host sends a <tt>System.Notify(''Target'', ''Ident'', ''StatusWord'')</tt> to ''Target''.
  
==Detailed description==
+
* The ''Target'' receives the message and updates its state accordingly
''<span style="color:red;">No additional information</span>''
 
  
  
Line 33: Line 50:
 
===Calling in a calculation===
 
===Calling in a calculation===
 
* Add to a calculation icon: <pre class="brush:[cpp]">::System.Notify(target, ident, data)</pre>
 
* Add to a calculation icon: <pre class="brush:[cpp]">::System.Notify(target, ident, data)</pre>
 
''<span style="color:red;">No additional information</span>''
 

Latest revision as of 11:55, 16 January 2023

Fc9-comp-macro.png Notify
Sends a System.User message to the targeted component 
Fc9-h32-icon.png - HANDLE Target
The component to send the message to 
Fc9-u32-icon.png - ULONG Ident
A user-defined value for identification purposes 
Fc9-u32-icon.png - ULONG Data
Some user-defined data to send to the target 
Fc9-void-icon.png - NONE Return


Detailed description

Notifications are posted between components using the event System.User. This is invoked by this Notify message. Here Target is the component to post the message to.


Ident and Data are user defined values - Flowcode does not put any constraints on what these are, but by convention Ident is specified by the recipient of the message in order to identify this from other System.User messages.


Note that as this message is post instead of sent, the Target may not receive the message immediately, and the caller should not wait for a reply inside an event macro.


A typical timeline of events involving this message are:

  • Initialise called and Target calls a Register(Ident) function in the host
  • An event (such as a mouse click) causes the state of the host to change
  • The host sends a System.Notify(Target, Ident, StatusWord) to Target.
  • The Target receives the message and updates its state accordingly


Examples

Calling in a calculation

  • Add to a calculation icon:
    ::System.Notify(target, ident, data)