KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Class API Function Documentation
PRODUCT: 4D | VERSION: 19 R | PLATFORM: Mac & Win
Published On: May 9, 2022

With ORDA and Object Notation features becoming more prominent in 4D it can be useful to access the documentation to clarify the functions of the 4D classes. With the classic 4D language, commands allowed access to the documentation for the command by using the F1 shortcut or the contextual menu on the command in the method editor.

With functions, the access to the documentation is a bit more nuanced due to the difficulty of determining if the function is a 4D function, a custom function, or an attribute. To confirm that the function is a 4D function, the parent item that the function is being applied to must be the specific class.

For example, with collection functions, the following will allow access to the documentation for the .push() function:

var $myCol : Collection
$myCol.push()


However, the the nuances come when the functions are applied to a attributes. The following will not allow access to the documentation:
var $myObj : Object
$myObj.Col:=New Collection
$myObj.Col.push()


A quick way to tell if the parent item will allow the documentation for a function to be opened is to check it's autocomplete suggestion.
As shown below New collection auto suggests functions of the collection class and as such will allow access to the documentation:

Thus the following code will allow opening the documentation for .push():
New collection.push()


Split string, which also returns a collection does not auto suggest any functions of the collection class, and as such will not allow access to the documentation:

Thus the following code will not allow opening the documentation for .push():
Split string.push()