Foundation 6

Fnd_VS

18 shared methods.

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.

ParameterTypeDirectionDescription
tablePointerinThe 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.

ParameterTypeDirectionDescription
fieldPointerinA pointer to a field
ResultTextoutThe 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.

ParameterTypeDirectionDescription
tablePointerinA pointer to a table
fieldPtrsArrayPointerinA pointer to a pointer array to receive the field pointers
fieldNamesArrayPointerinA 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.

ParameterTypeDirectionDescription
tablePtrsArrayPointerinA pointer to a pointer array to receive the table pointers
tableNamesArrayPointerinA 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.

ParameterTypeDirectionDescription
requestTextinInfo desired ("version" or "name")
ResultTextoutResponse

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
ParameterTypeDirectionDescription
tableNumberIntegerinThe table to scan
ResultIntegeroutThe 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.

ParameterTypeDirectionDescription
oldTextinThe string to replace
newTextinThe 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.

ParameterTypeDirectionDescription
fieldPointerinThe field to rename
titleTextinThe virtual title
ResultoutNone

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.

ParameterTypeDirectionDescription
tablePointerinThe table to use
fieldNamesArrayPointerinArray of field titles
fieldNumbersArrayPointerinArray of field numbers
ResultoutNone

Fnd_VS_SetTableTitle

Fnd_VS_SetTableTitle (->table; title)

Allows the developer to set a virtual table title for a single table.

ParameterTypeDirectionDescription
tablePointerinThe table to rename
titleTextinThe virtual title
ResultoutNone

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.

ParameterTypeDirectionDescription
tableNamesArrayPointerinArray of table titles
tableNumbersArrayPointerinArray of table numbers
ResultoutNone

Fnd_VS_ShowTable

Fnd_VS_ShowTable (->table)

Adds a table to the virtual structure arrays.

ParameterTypeDirectionDescription
tablePointerinA 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.

ParameterTypeDirectionDescription
tablePointerinA pointer to a table
ResultTextoutThe 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.

ParameterTypeDirectionDescription
tablePointerinA table
ResultBooleanoutTrue 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.

ParameterTypeDirectionDescription
listNameTextinThe name of a list belonging to the HOST database
ResultObjectoutOne property per route attempted