Difference between revisions of "API System.Notify"

From Flowcode Help
Jump to navigationJump to search
(XML import)
(XML import)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<sidebar>API contents</sidebar>
+
<sidebar>API Contents</sidebar>
 
Sends a System.User message to the targeted component
 
Sends a System.User message to the targeted component
  
Line 10: Line 10:
  
 
==Parameters==
 
==Parameters==
[[Variable types|HANDLE]] ''Target''
+
[[Variable Types|HANDLE]] ''Target''
 
:The component to send the message to
 
:The component to send the message to
  
[[Variable types|ULONG]] ''Ident''
+
[[Variable Types|ULONG]] ''Ident''
 
:A user-defined value for identification purposes
 
:A user-defined value for identification purposes
 
:''The default value for this parameter is: '''''0'''
 
:''The default value for this parameter is: '''''0'''
  
[[Variable types|ULONG]] ''Data''
+
[[Variable Types|ULONG]] ''Data''
 
:Some user-defined data to send to the target
 
:Some user-defined data to send to the target
 
:''The default value for this parameter is: '''''0'''
 
:''The default value for this parameter is: '''''0'''
Line 27: Line 27:
  
 
==Detailed description==
 
==Detailed description==
''<span style="color:red;">No additional information</span>''
+
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.
 +
 
 +
 
 +
''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.
 +
 
 +
 
 +
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 <tt>Register(''Ident'')</tt> function in the host
 +
 
 +
* An event (such as a mouse click) causes the state of the host to change
 +
 
 +
* The host sends a <tt>System.Notify(''Target'', ''Ident'', ''StatusWord'')</tt> to ''Target''.
 +
 
 +
* The ''Target'' receives the message and updates its state accordingly
  
  
Line 34: Line 50:
 
* 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>''
+
''<span style="color:red;">No additional examples</span>''

Latest revision as of 15:58, 16 January 2014

<sidebar>API Contents</sidebar> Sends a System.User message to the targeted component

Class hierarchy

System

Notify

Parameters

HANDLE Target

The component to send the message to

ULONG Ident

A user-defined value for identification purposes
The default value for this parameter is: 0

ULONG Data

Some user-defined data to send to the target
The default value for this parameter is: 0


Return value

This call does not return a value


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)

No additional examples