Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
number_value [2015/10/11 23:59] admin |
number_value [2026/08/28 03:29] (current) hermann Sync from local documentation review |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Number Value ====== | + | ====== Number Value ====== |
| ===== Description ===== | ===== Description ===== | ||
| - | This hook identifies a value by assigning a number to it. | + | This hook functor identifies a value by assigning a number to it, so that a container built to consume numbered values — most commonly one of the calculator functors, such as [[Calculate Map]] — can pick it out by that number. It performs no computation itself: the enclosing container inspects its Value and Value Number ports and registers the value under that number, making it available as v''N'' inside the container's expression. |
| ===== Inputs ===== | ===== Inputs ===== | ||
| ^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
| - | | Value | [[Real Value Type]] | Any value. | | + | | Value | [[Real Value Type]] | Value to identify. | |
| - | | Value Number | [[Positive Integer Value Type]] | Value number identifier. | | + | | Value Number | [[Positive Integer Value Type]] | Number by which the value will be known inside the container — for example, 1 makes it available as v1. | |
| ===== Optional Inputs ===== | ===== Optional Inputs ===== | ||
| + | |||
| + | None. | ||
| ===== Outputs ===== | ===== Outputs ===== | ||
| + | |||
| + | None. | ||
| ===== Group ===== | ===== Group ===== | ||
| - | [[Functor List#Map Algebra Supplementary | Map Algebra Supplementary ]] | + | [[Functor List#Map Algebra Supplementary | Map Algebra Supplementary]] |
| - | ===== Notes ===== | + | ===== Notes ===== |
| - | A hook is usually used to enter a type of data into a container that performs some operation. | + | ==== Purpose as a placeholder ==== |
| - | ===== Internal Name ===== | + | Number Value only stores the value and the number under which it should be registered. The container it is placed inside inspects those ports and performs the actual registration. |
| + | |||
| + | ==== Valid containers ==== | ||
| + | |||
| + | This functor must be placed directly inside one of the containers that consume numbered values — [[Calculate Map]], [[Calculate Categorical Map]], [[Calculate Lookup Table Values]], [[Calculate Value]], [[Create String]], [[Calculate R Expression]], [[Calculate Python Expression]], or [[Calculate Lookup Table Keys And Values]]. Placing it inside any other functor is not supported and will fail validation. | ||
| + | |||
| + | ==== Referencing the value in an expression ==== | ||
| + | |||
| + | Once registered, the value is available inside the container's expression as vN (for example, Value Number = 1 gives v1). This applies to the verbose syntax only. The separate abbreviated syntax eliminates hook functors like Number Value entirely, referencing each connected input directly by its port name instead — see [[EGO Script#Calculator functor shorthand|Calculator functor shorthand]]. | ||
| + | |||
| + | ==== Visual banner ==== | ||
| + | |||
| + | Value Number is normally set to a fixed constant chosen by the model author; connecting it to another functor's output instead reports a warning, since the identifier is meant to stay fixed and readable. | ||
| + | |||
| + | Once Value Number is set, this functor's banner in the model diagram shows "#N"; once the value itself is known, it reads "Value #N is X" (for example, "Value #1 is 42"), making the variable easy to identify in the diagram. | ||
| + | |||
| + | ===== Internal Name ===== | ||
| NumberValue | NumberValue | ||
| + | |||
| + | ===== Usage examples ===== | ||
| + | |||
| + | [[Calculate Map#Connecting data inputs|Connecting data inputs]] in the Calculate Map documentation — shows Number Value exposing a scalar as v1. | ||