Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
number_value [2015/10/11 23:59] admin |
number_value [2026/08/20 01:03] (current) hermann |
||
|---|---|---|---|
| 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 real (scalar) value with a numeric identifier so it can be used inside a container functor that expects one or more scalar inputs — most commonly one of the [[calculate_functors|calculator family]], such as [[calculate_map|Calculate Map]]. It performs no computation itself: the container inspects its ''Value'' and ''Value Number'' ports and registers the value under that number, making it available as ''v1'' in the container's expression (verbose syntax — see [[#referencing_the_value_in_an_expression|below]]). |
| ===== Inputs ===== | ===== Inputs ===== | ||
| - | ^ Name ^ Type ^ Description ^ | + | ^ Name ^ Type ^ Description ^ |
| - | | Value | [[Real Value Type]] | Any value. | | + | | Value | [[real_value_type|Real Value Type]] | The value to be registered in the container. | |
| - | | Value Number | [[Positive Integer Value Type]] | Value number identifier. | | + | | Value Number | [[positive_integer_value_type|Positive Integer Value Type]] | The number by which the value will be known inside the container (e.g., ''1'' → ''v1''). Enter this directly rather than connecting it from another functor's output — a connection is allowed but triggers a validation warning, since the identifier is meant to stay fixed and readable. | |
| - | + | ||
| - | ===== Optional Inputs ===== | + | |
| ===== Outputs ===== | ===== Outputs ===== | ||
| + | |||
| + | This functor has no output ports; it only declares data for the enclosing container to pick up. | ||
| ===== Group ===== | ===== Group ===== | ||
| - | [[Functor List#Map Algebra Supplementary | Map Algebra Supplementary ]] | + | [[functor_list#map_algebra_suppl|Map Algebra (Suppl.)]] |
| + | |||
| + | ===== Notes ===== | ||
| + | |||
| + | ==== Purpose as a placeholder ==== | ||
| + | |||
| + | ''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 ==== | ||
| + | |||
| + | ''Number Value'' can only be placed directly inside one of the following container functors: | ||
| + | |||
| + | * [[calculate_map|Calculate Map]] | ||
| + | * [[calculate_categorical_map|Calculate Categorical Map]] | ||
| + | * [[calculate_lookup_table_values|Calculate Lookup Table Values]] | ||
| + | * [[calculate_value|Calculate Value]] | ||
| + | * [[create_string|Create String]] | ||
| + | * [[calculate_r_expression|Calculate R Expression]] | ||
| + | * [[calculate_python_expression|Calculate Python Expression]] | ||
| + | * [[calculate_lookup_table_keys_and_values|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'' (e.g., **Value Number** = ''1'' → ''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 ==== | ||
| - | ===== Notes ===== | + | Once **Value Number** is set, the sketch banner shows ''#N''; once the value itself is known it reads "Value #N is X" (e.g., "Value #1 is 42"), making the variable easy to identify in the model diagram. |
| - | A hook is usually used to enter a type of data into a container that performs some operation. | + | ===== Internal Name ===== |
| - | ===== 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''. | ||