4D v13.4

METHOD GET CODE

Home

 
4D v13.4
METHOD GET CODE

METHOD GET CODE 


 

METHOD GET CODE ( path ; code {; *} ) 
Parameter Type   Description
path  Text, Text array in Text or Text array containing one or more method path(s)
code  Text, Text array in Code of designated method(s)
Operator in If passed = command applies to host database when executed from a component (parameter ignored outside of this context)

The METHOD GET CODE command returns, in the code parameter, the contents of the method(s) designated by the path parameter. This command can return the code of all types of methods: database methods, triggers, project methods, form methods and object methods.

You can use two types of syntaxes, based either on text arrays, or text variables:

 C_TEXT(tVpath// text variables
 C_TEXT(tVcode)
 METHOD GET CODE(tVpath;tVcode) // code of a single method

 ARRAY TEXT(arrPaths;0) // text arrays
 ARRAY TEXT(arrCodes;0)
 METHOD GET CODE(arrPaths;arrCodes) // code of several methods

You cannot mix the two syntaxes.

If you pass an invalid pathname, the code parameter is left empty and an error is generated. 

In the text of the code generated by this command:

  • Command names are written in English in all versions of 4D except for the French version (where they are written in French).
  • A line is added in the header of the code generated containing metadata used when importing code, for example:
      // %metadata= {invisible:true,lang:"fr"}

    During an import, this line is not imported and only the specified attributes are taken into account. The "lang" attribute sets the export language and prevents an import into an application in a different language (in this case, an error is generated).

If the command is executed from a component, it applies by default to the component methods. If you pass the * parameter, it accesses the methods of the host database.

Example  

Refer to the example of the METHOD SET CODE command.

 
PROPERTIES 

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

 
INDEX

Alphabetical list of commands

 
HISTORY 

New
Created: 4D v13

 
SEE ALSO 

METHOD SET CODE