Fnd_Gen
44 shared methods.
- Fnd_Gen_Alert
- Fnd_Gen_BugAlert
- Fnd_Gen_BugAlert2
- Fnd_Gen_ButtonText
- Fnd_Gen_CanCallHostMethod
- Fnd_Gen_CancelQuit
- Fnd_Gen_CenterWindow
- Fnd_Gen_ComponentAvailable
- Fnd_Gen_ComponentCheck
- Fnd_Gen_ComponentData
- Fnd_Gen_ComponentInfo
- Fnd_Gen_CurrentFormType
- Fnd_Gen_CurrentTable
- Fnd_Gen_DummyMethod
- Fnd_Gen_FieldIsVisible
- Fnd_Gen_FileName
- Fnd_Gen_FormMethod
- Fnd_Gen_GetArrayWidth
- Fnd_Gen_GetDatabaseInfo
- Fnd_Gen_GetString
- Fnd_Gen_Info
- Fnd_Gen_IsRunning
- Fnd_Gen_LaunchAsNewProcess
- Fnd_Gen_Localize
- Fnd_Gen_MenuBar
- Fnd_Gen_Platform
- Fnd_Gen_PlugInAvailable
- Fnd_Gen_PositionR
- Fnd_Gen_QuitNow
- Fnd_Gen_Quitting
- Fnd_Gen_RequiredHookMethod
- Fnd_Gen_RequiredHostMethod
- Fnd_Gen_Reset
- Fnd_Gen_RunningInHost
- Fnd_Gen_SelectionChanged
- Fnd_Gen_SetDatabaseInfo
- Fnd_Gen_SetLocalizationStrings
- Fnd_Gen_SilentError
- Fnd_Gen_TableIsVisible
- Fnd_Gen_TableOf
- Fnd_Gen_ToolbarDisplayed
- Fnd_Gen_UIWorker
- Fnd_Gen_VerifyStructureItem
- Fnd_Gen_WaitToContinue
Fnd_Gen_Alert
Fnd_Gen_Alert (message{; button text})
Displays an alert message. Uses the Foundation Dialog module alert if available.
| Parameter | Type | Direction | Description |
|---|---|---|---|
message | Text | in | The alert message text |
button | Text | in | The button label (optional) |
Fnd_Gen_BugAlert
Fnd_Gen_BugAlert (method{; details{; options}})
Reports a code bug without blocking the caller: a Foundation log entry, a line in the system standard output, and an alert shown by another process so this one carries on.
The alert shows the method and the description only. Diagnostic detail belongs in options.columns, which is logged but not shown.
options.seconds turns the alert into a self-dismissing notification of that many seconds instead of a modal dialog. Pass it from any call site that knows nobody is watching: a modal in an unattended process waits forever, and the compile-check scheduler stops answering behind one. A notification is not guaranteed to be seen - the OS may suppress or silence it - so it buys "will not block", not "will be read".
Fnd_Gen_BugAlert(Current method name; "No number known for \""+$name_t+"\".")
Fnd_Gen_BugAlert(Current method name; "Lookup failed."; {columns: [$module_t; $code_t]})
| Parameter | Type | Direction | Description |
|---|---|---|---|
methodName | Text | in | Method name (4D's 'Current method name' function doesn't work in components) |
description | Text | in | Details about the problem (optional) |
options | Object | in | { columns | Collection ; seconds | Integer } extra detail, logged only, and |
Fnd_Gen_BugAlert2
Fnd_Gen_BugAlert2 (title; description{; options})
Reports a code bug without blocking the caller. Kept as a name only: Fnd_Gen_BugAlert now does this, and this passes straight through to it.
Prefer Fnd_Gen_BugAlert in new code. This one exists so that the call sites migrated to it between 2026-05-09 and 2026-08-14 keep working, and so that a host calling it is unaffected.
| Parameter | Type | Direction | Description |
|---|---|---|---|
title | Text | in | Short title, usually Current method name |
description | Text | in | Shown in the alert and logged |
options | Object | in | { columns | Collection } extra detail, logged only (optional) |
Fnd_Gen_ButtonText
Fnd_Gen_ButtonText (->button; text; alignment{; ->obj1..->objN}) --> Number
A replacement for 4D's BUTTON TEXT command.
Sets the button text and resizes the button if necessary. Also moves any adjacent form objects so they stay properly aligned with the modified button.
Due to a bug in 4D 2003.1, this routine won't work properly if the primary button is set as the default button. If this is a problem, UPGRADE!
| Parameter | Type | Direction | Description |
|---|---|---|---|
button | Variant | in | A pointer to the button, or its name |
text | Text | in | New button text |
alignment | Longint | in | Which end to keep stationary (optional) |
$4..$N | Variant | in | Other form objects to move, by pointer or by name |
Result | Longint | out | The increase in the button size |
Fnd_Gen_CanCallHostMethod
Fnd_Gen_CanCallHostMethod --> Boolean
True when EXECUTE METHOD, called from the component, will actually reach the named host method: the method exists and carries "Shared by components and host database". One that exists unshared raises -10508 when called.
Not thread safe, because METHOD Get attribute is not - probe once and cache the answer rather than asking per call.
The name must be literal. METHOD GET NAMES honours the @ wildcard, so a name containing one answers for whatever it happens to match.
| Parameter | Type | Direction | Description |
|---|---|---|---|
methodName | Text | in | Name of the host method |
Result | Boolean | out | True when the method exists and is shared |
Fnd_Gen_CancelQuit
Fnd_Gen_CancelQuit
Call this to end Foundation's attempts to quit.
No parameters.
Fnd_Gen_CenterWindow
Fnd_Gen_CenterWindow (width; height{; type{; position{; title{; close box?}}}})
Opens a new window centered on the screen or over the frontmost window (depending on the value of Fnd_Gen_WindowPosition_i).
| Parameter | Type | Direction | Description |
|---|---|---|---|
width | Longint | in | Width of the new window |
height | Longint | in | Height of the new window |
inType | Longint | in | The window type (optional) |
inPosition | Longint | in | Window position (optional) |
inTitle | Text | in | The window title (optional) |
inHasCloseBox | Boolean | in | Has a close box (optional) |
Result | Longint | out | The window reference number |
Fnd_Gen_ComponentAvailable
Fnd_Gen_ComponentAvailable (component name) --> Boolean
Returns true if the component is installed.
| Parameter | Type | Direction | Description |
|---|---|---|---|
component | Text | in | The name of the component |
Result | Boolean | out | True if the component is available |
Fnd_Gen_ComponentCheck
Fnd_Gen_ComponentCheck (calling component; required component)
Alerts the developer if the specified component isn't available. Then ends execution.
| Parameter | Type | Direction | Description |
|---|---|---|---|
callingComponent | Text | in | The internal name of the calling component |
requiredComponent | Text | in | The internal name of the required component |
Fnd_Gen_ComponentData
Fnd_Gen_ComponentData (->prefixes array{; ->installed versions array{; ->current versions array}})
Modifies the arrays to contain the installed Foundation component prefixes, installed versions, and current versions.
| Parameter | Type | Direction | Description |
|---|---|---|---|
namesArray | Pointer | in | A text array to receive the component prefixes |
versionsArray | Pointer | in | A text array to receive the installed component version numbers (optional) |
crntVersionsArray | Pointer | in | A text array to receive the current component version numbers (optional) |
Fnd_Gen_ComponentInfo
Fnd_Gen_ComponentInfo (component name; info requested) --> Text
Pass this method a component name and name for the information you want. If the component exists, Foundation will call its _Info routine, pass it the info label, and return the result. This allows you to get information from a component in a single call, rather than having to first test to see if the component is available.
If the component isn't installed, "Component Not Available" will be returned.
If the component doesn't have an _Info routine, "Component Did Not Recognize Request" will be returned.
We recommend that if a component doesn't recognize a request it should return the text "Fnd_LabelNotRecognized". This routine will return this response as "Component Did Not Recognize Request".
These values will not be localized so the calling method can test for them.
| Parameter | Type | Direction | Description |
|---|---|---|---|
component | Text | in | The component name |
request | Text | in | Info desired |
Result | Text | out | Response from component |
Fnd_Gen_CurrentFormType
Fnd_Gen_CurrentFormType ({form type}) --> Number
If no parameters are passed, this method returns the type of the currently displayed form. Pass a form type to set the type of the currently displayed form.
Designed specifically so we can tell if the window is displaying an input form or an output form.
Can be one of these: 0 = Fnd_Gen_NoForm = No window 1 = Fnd_Gen_UnknownForm = Unknown form type 2 = Fnd_Gen_OutputForm = An output form 3 = Fnd_Gen_InputForm = An input form 4 = Fnd_Gen_PreferencesForm = The Preferences window 5 = Fnd_Gen_AboutForm = The About box
| Parameter | Type | Direction | Description |
|---|---|---|---|
inForm | Longint | in | The form type constant |
Result | Longint | out | The form type constant |
Fnd_Gen_CurrentTable
Fnd_Gen_CurrentTable ({->table}) --> Pointer
Returns a pointer to the current table. If no table is current, a nil pointer is returned.
Pass a pointer to a table to this routine to make it the current table.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inPointerTableMake | Pointer | in | A pointer to the table to make current (optional) |
Result | Pointer | out | The current table |
Fnd_Gen_DummyMethod
Fnd_Gen_DummyMethod
A generic method with no code. This is useful for assigning as the close box method
for new windows (handle the close in the form method) or to use with ON ERR CALL
to disable any automatic reaction to errors.
Deprecated 2026-08-22. Call Fnd_Gen_SilentError instead. The body was always empty, so the two methods were never different. This one served six ON ERR CALL sites and one Open window close box.
No parameters.
Fnd_Gen_FieldIsVisible
Fnd_Gen_FieldIsVisible ( fieldPtr | tableNum {; fieldNum} --> ReturnType
Determines if a field is visible
| Parameter | Type | Direction | Description |
|---|---|---|---|
inField | Pointer | in | Field pointer |
inField | Longint | in | Table number |
inFieldNumber | Longint | in | Field number |
Result | Boolean | out | True - the field is visible |
Fnd_Gen_FileName
Fnd_Gen_FileName (path) --> Text
Returns the file name from the full pathname.
| Parameter | Type | Direction | Description |
|---|---|---|---|
path | Text | in | A full pathname |
Result | Text | out | The file name at the end of the pathname |
Fnd_Gen_FormMethod
Fnd_Gen_FormMethod
Standard form method for non-modal forms.
Handles the close box and quitting the application. Responds to On Activate On Close Box On Outside Call Fnd_Gen_QuitNow Fnd_Wnd_CloseAllWindows
No parameters.
Fnd_Gen_GetArrayWidth
Fnd_Gen_GetArrayWidth (->text array; font; size; style) --> Number
Returns the width required to display the array text given the specified font settings.
Only measures the text - does not take into account the object used to display the text.
Basically this just measures the width of the longest element.
| Parameter | Type | Direction | Description |
|---|---|---|---|
array | Pointer | in | The text array to measure |
fontName | Text | in | The font name |
fontSize | Longint | in | The font size |
fontStyle | Longint | in | The font style |
Result | Longint | out | The width of the longest element |
Fnd_Gen_GetDatabaseInfo
Fnd_Gen_GetDatabaseInfo (info type) --> Text
Gets the specified database information value.
Use the Fnd_Gen_SetDatabaseInfo to set this information.
| Parameter | Type | Direction | Description |
|---|---|---|---|
label | Text | in | The info type label |
Result | Text | out | The value |
Fnd_Gen_GetString
Fnd_Gen_GetString (component; internal string{; replace1..replace5})
Calls the Foundation localization routines if they're available. If not, the default English string is returned.
| Parameter | Type | Direction | Description |
|---|---|---|---|
moduleName | Text | in | The component's code ("Fnd_xxx") |
internalLabel | Text | in | The lookup code |
inReplacementString1_t..$inReplacementString3 | Text | in | Replacement strings (optional) |
Result | Text | out | The localized string |
Fnd_Gen_Info
Fnd_Gen_Info (label) --> Text
Returns requested information. See the Fnd_Gen_ComponentInfo method for more information.
Responds to: version: The current version of the component name: The name of the component minimum_extras_version: The minimum version number of Foundation Extras to compare to the Fnd_Gen_ExtrasVersion constant minimum_extras_version_string: The minimum version number of Foundation Extras as a string compiled: Whether the component itself is running compiled, as the text "True" or "False" (not "1"/"0") — evaluated inside the component, so a host can tell its own compiled state from Foundation's
| Parameter | Type | Direction | Description |
|---|---|---|---|
request | Text | in | Info desired |
Result | Text | out | Response |
Fnd_Gen_IsRunning
Fnd_Gen_IsRunning --> Boolean
True when Foundation is loaded as a component inside a host, rather than being open as a project in its own right.
| Parameter | Type | Direction | Description |
|---|---|---|---|
Result | Boolean | out | True when running inside a host |
Fnd_Gen_LaunchAsNewProcess
Fnd_Gen_LaunchAsNewProcess (method name; process name) --> Boolean
Launches the specified process as a new process. If the process is already
running, it's just brought to the front.
| Parameter | Type | Direction | Description |
|---|---|---|---|
methodName | Text | in | The method name to launch |
newProcessName | Text | in | The name to give the new process |
Result | Boolean | out | True if we're in a new process |
Fnd_Gen_Localize
Fnd_Gen_Localize
Passed the localization strings to the General and (if available) Localization components.
No parameters.
Fnd_Gen_MenuBar
Fnd_Gen_MenuBar ({menu bar name})
If the Menu component is installed, it is called to handle the menu bar.
If it's not, nothing happens with the menus.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inMenuBarName | Text | in | menu bar name (optional) |
Fnd_Gen_Platform
Fnd_Gen_Platform --> Number
Returns the platform number.
Returns 10 if we're running on Mac OS X.
Returns 3 if we're running on Windows.
| Parameter | Type | Direction | Description |
|---|---|---|---|
Result | Longint | out | The platform number |
Fnd_Gen_PlugInAvailable
Fnd_Gen_PlugInAvailable (plug-in name) --> Boolean
Returns true if the plug-in is installed. This is done by executing a valid call to the plug-in, then checking to see if 4D set the Error variable to something other than zero.
| Parameter | Type | Direction | Description |
|---|---|---|---|
plugIn | Text | in | The name of the plug-in |
Result | Boolean | out | True if the plug-in is available |
Fnd_Gen_PositionR
Fnd_Gen_PositionR (find; string) --> Number
Just like 4D's Position function, but work backwards.
| Parameter | Type | Direction | Description |
|---|---|---|---|
find | Text | in | The string to find |
inString | Text | in | The string to search in |
Result | Longint | out | The position of the first character |
Fnd_Gen_QuitNow
Fnd_Gen_QuitNow ({quit?}) --> Boolean
Returns True if the user wants to quit. Pass True to tell Foundation to do its quit stuff now.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inQuit | Boolean | in | Cause Foundation to quit now? (optional) |
Result | Boolean | out | True if it's time to quit |
Fnd_Gen_Quitting
Fnd_Gen_Quitting ({$setQuittingStatus_b : Boolean}) --> Boolean
Reports whether the application is shutting down, and optionally sets it.
Getter and setter in one, on the usual Foundation pattern: called with no parameter it reports, called with one it sets and then reports.
| Parameter | Type | Direction | Description |
|---|---|---|---|
setQuittingStatus | Boolean | in | Sets the quitting state (optional) |
Result | Boolean | out | The state after any change |
Fnd_Gen_RequiredHookMethod
Fnd_Gen_RequiredHookMethod (method name)
Creates the specified method in the host database if it doesn't already exist.
If it does already exist and the host is interpreted, its declared parameters and return type are compared with those Foundation now uses. A mismatch is recorded for Fnd_Gen_GeneratedReport. A hook holds the host developer's own code, so it is never rewritten. A hook that declares nothing cannot be compared, as its parameters may be typed in a Compiler_ method; where Foundation passes it parameters or expects a result, it is recorded as left unchanged for the developer to check.
| Parameter | Type | Direction | Description |
|---|---|---|---|
methodName | Text | in | The name of the method to create |
Fnd_Gen_RequiredHostMethod
Fnd_Gen_RequiredHostMethod (method name)
Creates the specified method in the host database if it doesn't already exist.
If it does already exist and the host is interpreted, the parameter and return types it declares are compared with the current template's. A host copy declared differently is replaced by the template, the previous code kept below as a /* comment */, and the replacement is recorded for Fnd_Gen_GeneratedReport. A copy that differs only in how it is written is left alone, as is any method in a compiled host. A copy that declares nothing cannot be judged, so it is left alone and recorded for the developer to check.
| Parameter | Type | Direction | Description |
|---|---|---|---|
methodName | Text | in | The name of the method to create |
Fnd_Gen_Reset
Fnd_Gen_Reset
Resets all of the available Foundation components.
No parameters.
Fnd_Gen_RunningInHost
Fnd_Gen_RunningInHost ({running in host?}) --> Boolean
Tells whether Foundation is running as a component inside a host database. With a parameter, records the answer; without one, returns it.
| Parameter | Type | Direction | Description |
|---|---|---|---|
setFnd_Gen_RunningInHost | Boolean | in | True when Foundation is a component in a host (optional) |
Result | Boolean | out | True when running in a host |
Fnd_Gen_SelectionChanged
Fnd_Gen_SelectionChanged
Call this whenever the current selection of records displayed in the output list changes.
No parameters.
Fnd_Gen_SetDatabaseInfo
Fnd_Gen_SetDatabaseInfo (info type; value)
Sets the specified database information value.
Use the Fnd_Gen_GetDatabaseInfo to retrieve this information.
| Parameter | Type | Direction | Description |
|---|---|---|---|
label | Text | in | The info type label |
value | Text | in | The info value |
Fnd_Gen_SetLocalizationStrings
Fnd_Gen_SetLocalizationStrings (component; ->lookup codes; ->strings)
Called from the Fnd_xxx_Localize method of other components to pass their localization info to this, and (if available) the Localization component.
| Parameter | Type | Direction | Description |
|---|---|---|---|
component | Text | in | The component's code ("Fnd_xxx") |
lookupCodesArray | Pointer | in | Array of lookup codes |
stringsArray | Pointer | in | Array of localized strings |
Fnd_Gen_SilentError
Fnd_Gen_SilentError
A method with no code. Foundation's single no-op, for the two places one is wanted: swallowing an error, and satisfying a parameter that demands a method name but has nothing to do.
As an error handler, install it with ON ERR CALL around a call that is expected to fail and whose failure is not interesting, then restore the previous handler immediately:
$oldHandler_t:=Method called on error
ON ERR CALL("Fnd_Gen_SilentError")
...the call that may fail...
ON ERR CALL($oldHandler_t)
Leaving it installed suppresses every subsequent error in the process, including the ones that matter, so the restore is not optional.
As a close box method, pass its name to Open window when the close is handled in the form method:
$windowRef_i:=Open window($l; $t; $r; $b; $type_i; $title_t; "Fnd_Gen_SilentError")
No parameters.
Fnd_Gen_TableIsVisible
Fnd_Gen_TableIsVisible (Table pointer or number) --> Boolean
Returns TRUE if table $1-> is visible
| Parameter | Type | Direction | Description |
|---|---|---|---|
table | Pointer | in | the pointer to a table OR table number |
Result | Boolean | out | True = Visible table |
Fnd_Gen_TableOf
Fnd_Gen_TableOf (table pointer) --> field pointer
Returns a pointer to the table that the field passed in belongs to
| Parameter | Type | Direction | Description |
|---|---|---|---|
field | Pointer | in | A field Pointer |
Result | Pointer | out | The table the field belongs to |
Fnd_Gen_ToolbarDisplayed
Fnd_Gen_ToolbarDisplayed --> Boolean
Returns true if the design toolbar is visible
| Parameter | Type | Direction | Description |
|---|---|---|---|
Result | Boolean | out | Description |
Fnd_Gen_UIWorker
Fnd_Gen_UIWorker --> $worker_v : Variant
Returns the identifier of the UI worker every Foundation UI message is dispatched to — the host's "UI Process" hook value when one exists, otherwise "$Fnd_UI". Pass the result straight to CALL WORKER.
| Parameter | Type | Direction | Description |
|---|---|---|---|
Result | Variant | out | The UI worker's process name (Text) or process number (Integer) |
Fnd_Gen_VerifyStructureItem
Fnd_Gen_VerifyStructureItem (component; table or field name; field type{; indexed}) --> Pointer
Makes sure the required field exists. If not, the developer is notified.
| Parameter | Type | Direction | Description |
|---|---|---|---|
component | Text :The component prefix | in | |
fieldName | Text | in | The required table or field name |
inFieldType | Longint | in | The expected field type |
inIndexed | Boolean | in | The field should be indexed? (optional) |
Result | Pointer | out | A pointer to the field |
Fnd_Gen_WaitToContinue
Fnd_Gen_WaitToContinue (boolean)
Causes a process to wait
| Parameter | Type | Direction | Description |
|---|---|---|---|
Result | Boolean | out | whether or not to wait Added by Walt Nelson on 2/19/10 |