Fnd_VS
18 shared methods.
- Fnd_VS_AddTable
- Fnd_VS_CreateNameLists
- Fnd_VS_FieldName
- Fnd_VS_GetFields
- Fnd_VS_GetTables
- Fnd_VS_HandleError
- Fnd_VS_Info
- Fnd_VS_NbrValidFields
- Fnd_VS_ReplaceString
- Fnd_VS_SetFieldTitle
- Fnd_VS_SetFieldTitles
- Fnd_VS_SetTableTitle
- Fnd_VS_SetTableTitles
- Fnd_VS_ShowTable
- Fnd_VS_TableName
- Fnd_VS_UseNameLists
- Fnd_VS_WasSubtable
- Fnd_VS_zProbeHostLists
Fnd_VS_AddTable
Fnd_VS_AddTable (->table)
Adds the specified table, and all of its fields, to the virtual structure arrays.
Doesn't call 4D's SET TABLE TITLES command.
This is a private method. To add a table the developer will normally call the Fnd_VS_ShowTable method.
We don't use semaphores here. We assume the calling process is using the semaphore.
| Parameter | Type | Direction | Description |
|---|---|---|---|
table | Pointer | in | The table to add |
Fnd_VS_CreateNameLists
Fnd_VS_CreateNameLists
Creates the 4D lists that can be used by the virtual structure routines.
No parameters.
Fnd_VS_FieldName
Fnd_VS_FieldName (->field) --> Text
Returns the virtual field name of the specified field.
| Parameter | Type | Direction | Description |
|---|---|---|---|
field | Pointer | in | A pointer to a field |
Result | Text | out | The virtual field name |
Fnd_VS_GetFields
Fnd_VS_GetFields (->table; ->pointer array{; ->text array})
Returns in the passed arrays the pointers to and the field names of all of the visible fields for the specified table.
| Parameter | Type | Direction | Description |
|---|---|---|---|
table | Pointer | in | A pointer to a table |
fieldPtrsArray | Pointer | in | A pointer to a pointer array to receive the field pointers |
fieldNamesArray | Pointer | in | A pointer to a text array to receive the field names (optional) |
Fnd_VS_GetTables
Fnd_VS_GetTables (->pointer array{; ->text array})
Returns in the passed arrays the names of and pointers to all of the visible tables.
Returns the arrays already sorted in the order the developer wants them sorted.
| Parameter | Type | Direction | Description |
|---|---|---|---|
tablePtrsArray | Pointer | in | A pointer to a pointer array to receive the table pointers |
tableNamesArray | Pointer | in | A pointer to a text array to receive the table names (optional) |
Fnd_VS_HandleError
Fnd_VS_HandleError
Special Error handling for the Virtual Structure component.
No parameters.
Fnd_VS_Info
Fnd_VS_Info (label) --> Text
Returns requested information. See the Fnd_Gen_ComponentInfo method for more information.
| Parameter | Type | Direction | Description |
|---|---|---|---|
request | Text | in | Info desired ("version" or "name") |
Result | Text | out | Response |
Fnd_VS_NbrValidFields
Fnd_VS_NbrValidFields ($tableNumber_i : Integer) --> Integer
Counts the fields of a table that the virtual structure treats as valid.
Two negative results are error codes rather than counts, so test for them before using the number:
-1 no table number was passed
-2 the table number is not a valid table
| Parameter | Type | Direction | Description |
|---|---|---|---|
tableNumber | Integer | in | The table to scan |
Result | Integer | out | The count, or -1 / -2 as above |
Fnd_VS_ReplaceString
Fnd_VS_ReplaceString (old string; new string)
Does a find and replace in all of the virtual table titles and field titles.
Designed specifically to quickly replace underscores with spaces, but could also be used for other global changes.
| Parameter | Type | Direction | Description |
|---|---|---|---|
old | Text | in | The string to replace |
new | Text | in | The string to replace it with |
Fnd_VS_SetFieldTitle
Fnd_VS_SetFieldTitle (->field; title)
Allows the developer to set a virtual field title for a single field.
| Parameter | Type | Direction | Description |
|---|---|---|---|
field | Pointer | in | The field to rename |
title | Text | in | The virtual title |
Result | out | None |
Fnd_VS_SetFieldTitles
Fnd_VS_SetFieldTitles (->table; ->field titles; ->field numbers)
Allows the developer to set virtual field titles. Designed to be called as a replacement to 4D's SET FIELD TITLES command.
| Parameter | Type | Direction | Description |
|---|---|---|---|
table | Pointer | in | The table to use |
fieldNamesArray | Pointer | in | Array of field titles |
fieldNumbersArray | Pointer | in | Array of field numbers |
Result | out | None |
Fnd_VS_SetTableTitle
Fnd_VS_SetTableTitle (->table; title)
Allows the developer to set a virtual table title for a single table.
| Parameter | Type | Direction | Description |
|---|---|---|---|
table | Pointer | in | The table to rename |
title | Text | in | The virtual title |
Result | out | None |
Fnd_VS_SetTableTitles
Fnd_VS_SetTableTitles (->table titles; ->table numbers)
Allows the developer to set virtual table titles. Designed to be called as a replacement to 4D's SET TABLE TITLES command.
| Parameter | Type | Direction | Description |
|---|---|---|---|
tableNamesArray | Pointer | in | Array of table titles |
tableNumbersArray | Pointer | in | Array of table numbers |
Result | out | None |
Fnd_VS_ShowTable
Fnd_VS_ShowTable (->table)
Adds a table to the virtual structure arrays.
| Parameter | Type | Direction | Description |
|---|---|---|---|
table | Pointer | in | A pointer to the table to let the user see |
Fnd_VS_TableName
Fnd_VS_TableName (->table) --> Text
Returns the virtual table name of the specified table.
| Parameter | Type | Direction | Description |
|---|---|---|---|
table | Pointer | in | A pointer to a table |
Result | Text | out | The virtual table name |
Fnd_VS_UseNameLists
Fnd_VS_UseNameLists
Uses the virtual structure 4D lists.
No parameters.
Fnd_VS_WasSubtable
Fnd_VS_WasSubtable (->table) --> Boolean
Returns true if the referenced table was a subtable Test is done on the "id_added_by_converter" field name.
| Parameter | Type | Direction | Description |
|---|---|---|---|
table | Pointer | in | A table |
Result | Boolean | out | True if the table was converted from a subtable Based on the WasSubtable method donated by by Jérôme Pupier WBS 03 December 2024: Swap to var syntax for declarations ---------------------------------------------------- #DECLARE($table_ptr : Pointer)->$wasSubtable_b : Boolean var $tableNum_i; $loop_i; $lastFieldNumber_i : Integer var $fieldName_t : Text |
Fnd_VS_zProbeHostLists
Fnd_VS_zProbeHostLists ($listName_t : Text) --> Object
A diagnostic, kept deliberately: the answer varies by host, and knowing which route works in a particular database decides how that host is migrated off 4D lists.
Reports, from inside the component, which routes to a host's choice list actually work. Call it from a host with the name of one of the host's own lists.
Fnd_VS_zProbeHostLists("VS_Table002_EN")
Each route is reported as an object with a "worked" Boolean and what it found, so one call answers all of them and a failure in one does not hide the rest. A route that raises is silenced and reports worked:False with no further detail: Try...Catch...End try, which could report the error, is 20 R5 and this component still builds on 20.x LTS.
| Parameter | Type | Direction | Description |
|---|---|---|---|
listName | Text | in | The name of a list belonging to the HOST database |
Result | Object | out | One property per route attempted |