Module Management
The Module Management toolbox has three nodes that add members to a document, a type or a graph, from the canvas:
- Define Data Member adds a value that lasts between calls, such as a running total or a score.
- Define Behavior Member adds a Function or a Routine that belongs to the graph you are on.
- Define Local Variable adds a variable to a Routine, with a starting value for each call.
Use them when a graph needs memory or its own helper graphs. The same actions are also in the Properties panel; see Data members and starting values.
- Included in: Divooka Explore and Divooka Compute, every tier. Every document has it, even one made from the Blank workload.
- Maturity: Stable · Support: Tier 1 (proposed) · what these mean
- Open it: node library (
Ctrl+Shift+Space) → Module Management, or search for a node withCtrl+Space. - Examples and reference:
Ctrl+Shift+E→ Basics > Events Graph Members · node reference
New to graphs? Start with Your first program.
Example: an Events graph with its own members
The task: greet two people, count the greetings, and square a number, all inside one Events graph.
Open Basics > Events Graph Members (Ctrl+Shift+E). The graph Greeter has, on its own canvas:
- A data member Greetings, made with Define Data Member.
- A Routine Greet, made with Define Behavior Member. It adds 1 to Greetings and prints a greeting with the count.
- A Function Square, also made with Define Behavior Member. It returns X times X.
- The Start event calls Greet twice and Square once.
Double-click a member's node to open its graph. Run it with F5:
Hello, Ada! (greeting 1)
Hello, Grace! (greeting 2)
Seven squared is 49.
2 greetings in all.
The second greeting says 2 because Greetings is a data member: its value lasts between the two calls.
To make your own: press Ctrl+Space on an empty canvas, choose Define Behavior Member, name it and choose Function or Routine.
Tips and limits
- Names follow C# rules. A member's name must be a valid identifier: letters, digits and underscores, not starting with a digit.
- A Function has no steps. It is worked out wherever its answer is needed. Put actions that print, save or change data members in a Routine.
What is in the toolbox
| Category | Some of its nodes |
|---|---|
| Data Members | Define Data Member |
| Behavior Members | Define Behavior Member |
| Local Variables | Define Local Variable |
See also
- Module Management node reference
- Graphs and members - the kinds of graph and their members.
- Toolboxes - every other toolbox.