Foundation 6

Fnd_Shell

27 shared methods.

Fnd_Shell_Administration

Fnd_Shell_Administration

Displays Foundation's Administration dialog.

No parameters.

Fnd_Shell_CommandWrapper

Fnd_Shell_CommandWrapper ($commandToRun_t : Text{; $par1_v{; $par2_v{; $par3_v}}}) --> Variant

Calls a 4D command whose name has changed between versions, by number.

Command numbers are stable; their names are not. Command 254 is "Get last table number" up to 20 LTS and "Last table number" from 20 R10, and 33 commands were renamed between 20 and 21. A tokenised call is immune, because 4D resolves it by number - but source written outside the IDE has no token, so 4D must resolve it by name, and the wrong spelling becomes an undeclared variable. Ask Command name for the current spelling instead.

Tokens are why existing calls survive, not luck - and that is a setting, not a guarantee. Stored tokenless, every rename becomes a load-time name resolution.

The table holds only what Foundation itself calls. A host's own command usage is the host developer's to look after, not something to carry here.

Either spelling may be passed; both map to the same number. Foundation passes the oldest one - "Get last table number", not "Last table number" - so that the next rename lands in the table here and nowhere else.

Read the result into a local above the loop rather than calling per pass.

Every call builds the table below and compiles a formula.

Fnd_Shell_CommandWrapper("Get last table number")           -->  no parameters
Fnd_Shell_CommandWrapper("Get last field number"; $table)   -->  one, passed straight
Fnd_Shell_CommandWrapper($command; $a; $b; $c)              -->  up to three
Fnd_Shell_CommandWrapper($command; New collection($a; $b))  -->  a collection is the list

Pass the parameters as they come. A collection in the second position is taken as the whole parameter list, which is how to pass more than three - so a command whose own first parameter is a collection cannot be wrapped. None of the commands in the table below is such a command.

Only commands that return a value can be wrapped. An ALL-CAPS procedure returning through output parameters - PROCESS PROPERTIES, MOUSE POSITION - cannot be called this way. Build the call with Command name instead, as Fnd_Date_CalendarEventHandler does.

ParameterTypeDirectionDescription
commandToRunTextinThe command name, in any version's spelling
par1VariantinFirst parameter, or a collection holding all of them (optional)
par2VariantinSecond parameter (optional)
par3VariantinThird parameter (optional)
ResultVariantoutWhatever the command returns, or Null if it is not known here

Fnd_Shell_Documentation

Fnd_Shell_Documentation

Opens the Foundation Developer Reference (foundation.open4dshell.com/docs) in a web area.

No parameters.

Fnd_Shell_DoesMethodExist

Fnd_Shell_DoesMethodExist ($methodName_t) --> Longint

Replaces call to the old plugin which was deprecated in V14

ParameterTypeDirectionDescription
methodNameTextin$methodName_t
ResultLongintout-> 1 if method exists

Fnd_Shell_ExcludeFromQuit

Fnd_Shell_ExcludeFromQuit (process name)

Tells Foundation not to worry about the specified process when trying to quit.

ParameterTypeDirectionDescription
processNameTextinThe name of the process

Fnd_Shell_Find

Fnd_Shell_Find

Called from the Find menu bar item or toolbar item to display the Find dialog.

No parameters.

Fnd_Shell_GetFndObject

Fnd_Shell_GetFndObject --> ReturnType

Returns a copy of the Fnd object

ParameterTypeDirectionDescription
ResultObjectoutThe Fnd objects

Fnd_Shell_Info

Fnd_Shell_Info (label) --> Text

Returns requested information. See the Fnd_Gen_ComponentInfo method for more information.

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

Fnd_Shell_IsRunning

Fnd_Shell_IsRunning --> Boolean

Returns True if the shell is running.

ParameterTypeDirectionDescription
ResultBooleanoutIs the shell running?

Fnd_Shell_Localize

Fnd_Shell_Localize

Passed the localization strings to the General and (if available) Localization components.

No parameters.

Fnd_Shell_MenuBar

Fnd_Shell_MenuBar

A (hopefully) temporary method that asks the menu bar component to install the menu bar after a short delay. Must be run from a new process, but this method handles that.

This is necessary because a menu bar can't be installed at startup with the first version of 4D v11 SQL.

ParameterTypeDirectionDescription
inInternallyLongintinUsed internally

Fnd_Shell_NavigationPalette

Fnd_Shell_NavigationPalette

Displays Foundation's Navigation Palette.

No parameters.

Fnd_Shell_OnExit

Fnd_Shell_OnExit

Called from the shell's On Exit database method.

No parameters.

Fnd_Shell_OnStartup

Fnd_Shell_OnStartup

The startup routine for the Foundation Shell. Called from the On Startup database method.

No parameters.

Fnd_Shell_OpenTableAdd

Fnd_Shell_OpenTableAdd (->table{; ->table2...})

Adds the table(s) to the list of tables displayed in the Open Table dialog.

Tables are displayed in the order they are passed to this method.

ParameterTypeDirectionDescription
$1..$NPointerinThe table to add

Fnd_Shell_OpenTableDialog

Fnd_Shell_OpenTableDialog

Displays a dialog with the names of all visible tables. If the user selects one it's displayed in a new window.

No parameters.

Fnd_Shell_Print

Fnd_Shell_Print

Displays the list of printing options.

No parameters.

Fnd_Shell_ProcessName

Fnd_Shell_ProcessName ($processNumber_i : Integer) --> Text

Returns the name of a process, or an empty string if there is no such process. An empty result is the test for "has it gone".

Process info would answer this in one line but only from 20 R10, so the answer comes from Process activity, which every supported version has.

Process number 0 is not addressable: 4D gives it to its own preemptive processes, several at once. Asking for it returns an empty string.

ParameterTypeDirectionDescription
processNumberIntegerinThe process number to look up
ResultTextoutThe process name, or "" if it is not running

Fnd_Shell_QuitAllProcesses

Fnd_Shell_QuitAllProcesses --> Boolean

Attempts to end all processes (except for 4D's) by bugging them until they end.

Assumes they call the Fnd_Gen_QuitNow method to see if they're supposed to end.

Doesn't try to end the current process.

This method will give up (and return False) if any process cancels the Quit attempt or if the timeout value is reached.

ParameterTypeDirectionDescription
ResultBooleanoutTrue if all process ended as expected

Fnd_Shell_Quitter

Fnd_Shell_Quitter

This process tries to tell all of the other processes to quit.

Called as a new process from Fnd_Gen_QuitNow.

No parameters.

Fnd_Shell_SelectTable

Fnd_Shell_SelectTable --> Pointer

Displays a choice list of available tables. Returns a pointer to the selected table (if any). Sets the OK variable to 1 if a table is selected.

ParameterTypeDirectionDescription
ResultPointeroutA pointer to the selected table

Fnd_Shell_Show4DSplashScreen

Fnd_Shell_Show4DSplashScreen

Allows the developer to display the 4D splash screen so the database can be used in the User environment.

No parameters.

Fnd_Shell_ShowAll

Fnd_Shell_ShowAll

Called from the Show All menu bar item or toolbar item.

No parameters.

Fnd_Shell_Sort

Fnd_Shell_Sort

Called from the Sort menu bar item or toolbar item to display the Sort dialog.

No parameters.

Fnd_Shell_SpecialFunctions

Fnd_Shell_SpecialFunctions

Displays Foundation's Special Functions dialog.

No parameters.

Fnd_Shell_Storage

Fnd_Shell_Storage -> $storage_t

A developer utility to read the satate of Foundation

ParameterTypeDirectionDescription
ResultTextoutThe current state of the Storage.Fnd shared object

Fnd_Shell_WriteComments

Fnd_Shell_WriteComments {(Method Name; Do not use)}

This method will create documentation comments it is based on the assumption that you format your method header comments in the same manner as Foundation The second paramater is just used to trigger the method starting in a new process, you should not pass anything in this parameter

ParameterTypeDirectionDescription
inMethodNameTextinEither pass
inDoNotUseLongintinDo not use this