4D v13.4

METHOD GET PATHS

Home

 
4D v13.4
METHOD GET PATHS

METHOD GET PATHS 


 

METHOD GET PATHS ( {folderName ;} methodType ; arrPaths {; stamp}{; *} ) 
Parameter Type   Description
folderName  Text in Name of Home page folder
methodType  Longint in Selector of method type to get
arrPaths  Text array in Array of method paths and names
stamp  Longint variable in Minimum value of stamp
in New current value
Operator in If passed = command applies to host database when executed from a component (parameter ignored outside of this context)

The METHOD GET PATHS command fills the arrPaths array with the internal pathnames and names of methods in the application that are of the type specified by the methodType parameter.

If your code is organized in "folders" in the 4D Explorer (Home page), you can pass a folder name in the optional folderName parameter. In this case, the arrPaths array only contains paths of methods that are found in this location. 

Note: You cannot use the "@" character in folderName.

In the methodType parameter, you pass the type of method whose paths you want to get in the arrPaths array. You can use the following constants (individually or a combination of them), found in the  Design Object Access theme:

Constant Type Value Comment
Path All objects Longint 31 Paths of all the methods of the database
Path Database method Longint 2 Path of database methods specified (English name). List of these methods:
[databaseMethod]/onStartup
[databaseMethod]/onExit
[databaseMethod]/onDrop
[databaseMethod]/onBackupStartup
[databaseMethod]/onBackupShutdown
[databaseMethod]/onWebConnection
[databaseMethod]/onWebAuthentication
[databaseMethod]/onWebSessionSuspend
[databaseMethod]/onServerStartup
[databaseMethod]/onServerShutdown
[databaseMethod]/onServerOpenConnexion
[databaseMethod]/onServerCloseConnection
[databaseMethod]/onSystemEvent
[databaseMethod]/onSqlAuthentication
Path Project form Longint 4 Path of project form methods and all their object methods. Examples:
[projectForm]/myForm/{formMethod}
[projectForm]/myForm/button1
[projectForm]/myForm/my%2list
[projectForm]/myForm/button1
Path Project method Longint 1 Name of method.
Example: MyProjectMethod
Path Table form Longint 16 Path of table form methods and all their object methods. Example:
[tableForm]/table_1/Form1/{formMethod}
[tableForm]/table_1/Form1/button1
[tableForm]/table_1/Form1/my%2list
[tableForm]/table_2/Form1/my%2list
Path Trigger Longint 8 Path of database triggers. Example:
[trigger]/table_1
[trigger]/table_2

The stamp parameter lets you only get the paths of methods modified after a specific point in time. As part of a version control system, this means that you can update only methods that were modified since the last backup.
Here is how it works: 4D maintains a counter of method modifications. Each time a method is created or saved again, this counter is incremented and its current value is stored in the internal stamp of the method.
If you pass the stamp parameter, the command only returns methods whose stamp is greater than or equal to the value passed in this parameter. Moreover, the command returns, in stamp, the new current value of the modification counter, i.e. the highest value. If you save this value, you can pass it the next time this command is called so that you only get new or modified methods.

If the command is executed from a component, it returns by default the paths of the component methods. If you pass the * parameter, the array contains the paths of the methods of the host database.

Retrieval of project methods found in the "web" folder:

 METHOD GET PATHS("web", Path Project method;arrPaths)

Retrieval of database methods and triggers:

 METHOD GET PATHS(Path Trigger+Path Database method;arrPaths)

Retrieval of project methods that were modified since the last backup:

  // we load the last saved value
 $stamp :=Max([Backups]cur_stamp)
 METHOD GET PATHS(Path Project method;arrPaths;$stamp)
  // we save the new value
 CREATE RECORD([Backups])
 [Backups]cur_stamp :=$stamp
 SAVE RECORD([Backups])

Refer to the example of the METHOD SET CODE command.

 
PROPERTIES 

Product: 4D
Theme: Design Object Access
Number: 1163

 
INDEX

Alphabetical list of commands

 
HISTORY 

New
Created: 4D v13

 
SEE ALSO 

Current method path
METHOD GET FOLDERS