Differences

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

Link to this comparison view

Next revision
Previous revision
get_table_keys [2013/08/08 18:42]
admin created
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.  | 
-| Keys  | [[Table Type|Table]] ​ | The table containing the keys from the input table first key column. ​ |+ 
 +===== 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: +
- +
-^ Key1*  ^ Key2*  ^ Value1 ​ ^ Value2 ​ ^ +
-| 1  | 2  | 2.2  | 3.1  | +
-| 1  | 3  | 2.1  | 3.1  | +
-| 1  | 6  | 1.2  | 4.2  | +
-| 2  | 2  | 3.2  | 6.1  | +
- +
-yields +
- +
-Key*  ^ Value  ^ +
-| 1  | 1  | +
-| 2  | 2  | +
- +
-^ Name*  ^ Age*  ^ Value1 ​ ^ Value2 ​ ^ +
-| "​Hermann" ​ | 28  | 2.2  | 3.1  | +
-| "​Romulo" ​ | 12  | 2.1  | 3.1  | +
-| "​Bruno" ​ | 61  | 1.2  | 4.2  | +
-| "​Danilo" ​ | 25  | 3.2  | 6.1  | +
- +
-yields+
  
-Key*  ^ Value  ^ +If the first key column of Table is of type String, each unique string value is assigned a sequential real identifier (1, 2, 3, and so on), stored in Key, while the original string is kept in Value.
-| "​Hermann" ​ | "​Hermann" ​ | +
-| "​Romulo" ​ | "​Romulo" ​ | +
-| "​Bruno" ​ | "​Bruno" ​ | +
-| "​Danilo" ​ | "​Danilo" ​ |+
  
 ===== Internal Name ===== ===== Internal Name =====