Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
number_value [2026/08/20 01:03]
hermann
number_value [2026/08/28 03:29] (current)
hermann Sync from local documentation review
Line 3: Line 3:
 ===== Description ===== ===== Description =====
  
-This **hook** functor identifies a real (scalar) ​value with 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]]).+This hook functor identifies a value by assigning ​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|Real Value Type]] | The value to be registered in the container. | +| Value  | [[Real Value Type]] ​ Value to identify 
-| 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|+| 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 ===== 
 + 
 +None.
  
 ===== Outputs ===== ===== Outputs =====
  
-This functor has no output ports; it only declares data for the enclosing container to pick up.+None.
  
 ===== Group ===== ===== Group =====
  
-[[functor_list#map_algebra_suppl|Map Algebra ​(Suppl.)]]+[[Functor List#Map Algebra Supplementary ​| Map Algebra ​Supplementary]]
  
 ===== Notes ===== ===== Notes =====
Line 23: Line 27:
 ==== Purpose as a placeholder ==== ==== 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.+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 ==== ==== Valid containers ====
  
-''​Number Value''​ can only be placed directly inside one of the following container functors: +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.
- +
-  * [[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 ==== ==== 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]].+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 ==== ==== Visual banner ====
  
-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.+Value Number is normally ​set to a fixed constant chosen by the model author; connecting it to another functor'​s output instead reports a warningsince 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 knownit reads "Value #N is X" (for example, "Value #1 is 42"), making the variable easy to identify in the diagram.
  
 ===== Internal Name ===== ===== Internal Name =====
  
-''​NumberValue''​+NumberValue
  
 ===== Usage examples ===== ===== Usage examples =====
  
-  * [[calculate_map#connecting_data_inputs|Connecting data inputs]] in the Calculate Map documentation — shows ''​Number Value'' ​exposing a scalar as ''​v1''​.+[[Calculate Map#Connecting data inputs|Connecting data inputs]] in the Calculate Map documentation — shows Number Value exposing a scalar as v1.