Skip to main content
Version: Next

METHOD GET COMMENTS

METHOD GET COMMENTS ( path ; comments {; *} )

ParameterTypeDescription
pathText, Text arrayText or Text array containing one or more method path(s)
commentsText, Text arrayDocumentation of designated method(s)
*OperatorIf passed = command applies to host database when executed from a component (parameter ignored outside of this context)

This command is not thread-safe, it cannot be used in preemptive code.

Description

The METHOD GET COMMENTS command returns, in the comments parameter, the documentation of the method(s) designated by the path parameter.

The documentation retrieved by this command is displayed in the 4D Explorer (not to be confused with lines of comments in the code that are retrieved using METHOD GET CODE).

It contains:

  • markdown text in project databases
  • styled text in binary databases

This documentation can be generated for methods ot type triggers, project methods, form methods, database methods, and classes.

Note: Forms and form methods share the same documentation.

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

 var tVpath : Text // text variables
 var tVcomments : Text
 METHOD GET COMMENTS(tVpath;tVcomments) // documentation of a single method
 ARRAY TEXT(arrPaths;0) // text arrays
 ARRAY TEXT(arrComments;0)
 METHOD GET COMMENTS(arrPaths;arrComments) // documentation of several methods

You cannot mix the two syntaxes.

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.

See also

METHOD SET COMMENTS