4D v16.3METHOD GET CODE |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
METHOD GET CODE
METHOD GET CODE
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 ARRAY TEXT(arrPaths;0) // text arrays 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:
The option parameter allows you to select the code export mode with respect to the tokenized language elements of the method(s):
Tokenized language elements include:
Code exported with tokens is independent from any subsequent renaming of language elements. Thanks to tokens, code provided as text will always be interpreted correctly by 4D, whether by means of the METHOD SET CODE command or even by copy/paste. For more information about the syntax of 4D tokens, please refer to Using tokens in formulas. 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. Refer to the example of the METHOD SET CODE command. This example illustrates the effect of the option parameter. You want to export the following "simple_init" method: Case of If you execute the following code: C_TEXT($code) The resulting document will contain: //%attributes = {"lang":"en"} comment added and reserved by 4D If you execute the following code: C_TEXT($code) The resulting document will contain: //%attributes = {"lang":"en"} comment added and reserved by 4D
See also
|
PROPERTIES
Product: 4D
HISTORY
Created: 4D v13 ARTICLE USAGE
4D Language Reference ( 4D v16) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||