4D v14.3

Structure file

Home

 
4D v14.3
Structure file

Structure file 


 

Structure file {( * )} -> Function result 
Parameter Type   Description
Operator in Returns structure file of host database
Function result  String in Long name of the database structure file

The Structure file command returns the long name of the structure file for the database with which you are currently working.

On Windows
If, for example, you are working with the database MyCDs located in \DOCS\MyCDs on the volume G, the command returns G:\DOCS\MyCDs\MyCDs.4DB.

On Macintosh
If, for example, you are are working with the database located in the folder Documents:MyCDsƒ: on the disk Macintosh HD, the command returns Macintosh HD:Documents:MyCDsƒ:MyCDs.

Note: In the particular case of a database that has been compiled and merged with 4D Desktop, this command returns the pathname of the application file (executable application) under Windows and Mac OS. Under Mac OS, this file is located inside the software package, in the [Contents:Mac OS] folder. This stems from a former mechanism and is kept for compatibility reasons. If you want to get the full name of the software package itself, it is preferable to use the Application file command. The technique consists of testing the application using the Application type command, then executing Structure file or Application file depending on the context.

WARNING: If you call this command while running 4D Client, only the name of the structure file is returned; the long name is not returned.

The optional * parameter is useful in the case of an architecture using components: it can be used to determine the structure (host or component) for which you want to get the long name depending on the context in which the command is called:

  • When the command is called from a component:
    • If the * parameter is passed, the command returns the long name of the structure file of the host database,
    • If the * parameter is not passed, the command returns the long name of the structure file of the component.
      The structure file of the component corresponds to the .4db or .4dc file of the component found in the “Components” folder of the database. However, a component can also be installed as an alias/shortcut or a .4dbase folder/package:
      • In the case of a component installed as an alias/shortcut, the command returns the pathname of the original .4db or .4dc file (the alias or shortcut is resolved).
      • In the case of a component installed as a .4dbase folder/package, the command returns the pathname of the .4db or .4dc file located within this folder/package.
  • When the command is called from a method of the host database, it always returns the long name of the structure file of the host database, regardless of whether or not the * parameter is passed.

This example displays the name and the location of the structure file currently in use:

 If(Application type#4D Remote Mode)
    $vsStructureFilename:=Long name to file name(Structure file)
    $vsStructurePathname:=Long name to path name(Structure file)
    ALERT("You are currently using the database "+Char(34)+$vsStructureFilename+Char(34)+
    " located at "+Char(34)+$vsStructurePathname+Char(34)+".")
 Else
    ALERT("You are connected to the database "+Char(34)+Structure file+Char(34))
 End if

Note: The project methods Long name to file name and Long name to path name are listed in the section System Documents.

The following example can be used to find out whether the method is called from a component:

 C_BOOLEAN($0)
 $0:=(Structure file#Structure file(*))
  ` $0=True if method is called from a component

 
PROPERTIES 

Product: 4D
Theme: 4D Environment
Number: 489

Different in remote mode

 
HISTORY 

Modified: 4D v11 SQL

 
SEE ALSO 

Application file
COMPONENT LIST
Data file
DATA SEGMENT LIST

 
ARTICLE USAGE

4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)

Parent of : Structure file ( 4D v11 SQL Release 6)