Differences

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

Link to this comparison view

Both sides previous revision Previous revision
get_table_keys [2013/08/08 18:48]
admin
get_table_keys [2026/08/28 03:22] (current)
hermann Sync from local documentation review
Line 3: Line 3:
 ===== Description ===== ===== Description =====
  
-This functor returns ​a table containing only the first column of keys.+Returns ​a table mapping unique real identifiers to the keys of the first key column of a given table or lookup table. In case the keys of the given table are represented by real numbers, those numbers themselves are used as the unique identifiers.
  
 ===== Inputs ===== ===== Inputs =====
  
-^ Name ^ Type ^ Description ^ +^ Name  ^ Type  ^ Description ​ 
-| Table  | [[Table Type|Table]]  | The input table. ​ |+| Table  | [[Base Table Type]] ​ | Table or lookup ​table whose first key column'​s keys will be returned.  | 
 + 
 +===== Optional Inputs ===== 
 + 
 +None.
  
 ===== Outputs ===== ===== Outputs =====
  
-^ Name ^ Type ^ Description ^ +^ Name  ^ Type  ^ Description ​ 
-| Keys  | [[Table Type|Table]]  | The table containing ​the keys from the input table first key column. ​ |+| Keys  | [[Table Type]] ​ | Table mapping unique real identifiers to the keys of the input table'​s first key column, in the format "​Key*:​real,​ Value"​. The Value column has the same type as the input table'​s ​first key column. ​ |
  
 ===== Group ===== ===== Group =====
  
-[[Functor List#​Table|Table]]+[[Functor List#Table | Table]]
  
 ===== Notes ===== ===== Notes =====
  
-The result table has columns "Key*" ​and "Value" and both columns contain ​the same values. The column types are the same types of the first key column from the input table+If the first key column of Table is of type Real, its own values are used as the Key identifiers,​ so Key and Value hold the same numbers.
  
-**Example ​1:** +If the first key column of Table is of type String, each unique string value is assigned a sequential real identifier (123, and so on), stored in Key, while the original string is kept in Value.
- +
-Input: +
- +
-^ Key1*  ^ Key2*  ^ Value1 ​ ^ Value2 ​ ^ +
-|@lightgreen:​ 1  |  | 2.2  | 3.1  | +
-|@lightgreen:​ 1  | 3  | 2.1  | 3.1  | +
-|@lightgreen:​ 1  | 6  | 1.2  | 4.2  | +
-|@lightgreen:​ 2  | 2  | 3.2  | 6.1  | +
- +
-Result: +
- +
-Key*  ^ Value  ^ +
-|@lightgreen:​ 1  |@lightgreen:​ 1  | +
-|@lightgreen:​ 2  |@lightgreen:​ 2  | +
- +
-**Example 2:** +
- +
-Input: +
- +
-^ Name*  ^ Age*  ^ Value1 ​ ^ Value2 ​ ^ +
-|@lightgreen:​ "​Hermann" ​ | 28  | 2.2  | 3.1  | +
-|@lightgreen:​ "​Romulo" ​ | 12  | 2.1  | 3.1  | +
-|@lightgreen:​ "​Bruno" ​ | 61  | 1.2  | 4.2  | +
-|@lightgreen:​ "​Danilo" ​ | 25  | 3.2  | 6.1  | +
- +
-Result: +
- +
-^ Key*  ^ Value  ^ +
-|@lightgreen:​ "​Hermann" ​ |@lightgreen:​ "​Hermann" ​ | +
-|@lightgreen:​ "​Romulo" ​ |@lightgreen:​ "​Romulo" ​ | +
-|@lightgreen:​ "​Bruno" ​ |@lightgreen:​ "​Bruno" ​ | +
-|@lightgreen:​ "​Danilo" ​ |@lightgreen:​ "​Danilo" ​ |+
  
 ===== Internal Name ===== ===== Internal Name =====
  
 GetTableKeys GetTableKeys
 +