Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
print [2026/08/20 02:02] hermann |
print [2026/08/28 03:29] (current) hermann Sync from local documentation review |
||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ===== Description ===== | ===== Description ===== | ||
| - | ''Print'' is a container functor that prints messages to the application console around the execution of the functors it contains: an optional message before running its content, and an optional message after. It causes side effects (writing to the log/console) and otherwise simply runs its contained functors like any other container. | + | This container prints messages to the application console before and after executing the functors it contains. |
| + | |||
| + | ===== Inputs ===== | ||
| + | |||
| + | None. | ||
| ===== Optional Inputs ===== | ===== Optional Inputs ===== | ||
| - | ^ Name ^ Type ^ Description ^ | + | ^ Name ^ Type ^ Description ^ Default Value ^ |
| - | | Initial Message | [[string_type|String Type]] | Message printed before the container's content is executed. Nullable; the default value is none (nothing is printed). | | + | | Initial Message | [[String Type]] | Message printed before the contained functors execute. | None | |
| - | | Final Message | [[string_type|String Type]] | Message printed after the container's content is executed. Nullable; the default value is none (nothing is printed). | | + | | Final Message | [[String Type]] | Message printed after the contained functors execute. | None | |
| - | | Log Level | [[log_tag_type|Log Tag Type]] | The log level used to print both messages — for example, distinguishing a normal progress message from an error message. The default value is Unconditional. | | + | | Log Level | [[Log Tag Type]] | Log level used to print both messages. The log level indicates whether a message is a regular progress message or an error message, for example. | Unconditional | |
| ===== Outputs ===== | ===== Outputs ===== | ||
| - | This functor has no output ports; it acts through the side effect of printing to the console. | + | None. |
| ===== Group ===== | ===== Group ===== | ||
| - | [[functor_list#control|Control]] | + | [[Functor List#Control | Control]] |
| ===== Notes ===== | ===== Notes ===== | ||
| - | ==== Execution order ==== | + | Initial Message, when set, is printed before the contained functors run; Final Message, when set, is printed only after all of them have finished running. Both are printed using the level set in Log Level. |
| - | The initial message, if defined, is printed before the contained functors run; the final message, if defined, is printed only after all contained functors have finished running. Both messages are printed using the same ''logLevel''. | + | Using this container with nothing placed inside it is not recommended: with no contained functors to order its execution against, when the message is actually printed relative to the rest of the model becomes unspecified. |
| - | ==== Recommended usage ==== | + | This functor has no string-formatting capabilities of its own. To embed a computed value in a message, assemble the string first with [[Create String]] and connect its result into Initial Message or Final Message; some types are also converted to a string automatically when connected directly. |
| - | + | ||
| - | Using ''Print'' without any contained functors is not advised — with nothing inside to order its execution against, when the message is actually printed relative to the rest of the model becomes unspecified. | + | |
| - | + | ||
| - | ==== String formatting ==== | + | |
| - | + | ||
| - | ''Print'' has no string-formatting capabilities of its own. To build a formatted or composite message (embedding a computed value, for example), assemble the string first with [[create_string|Create String]] and connect its result into Initial Message or Final Message; some types are also automatically converted to String when connected directly. | + | |
| ===== Internal Name ===== | ===== Internal Name ===== | ||
| - | ''Print'' | + | |