Call chain
Call chain : Collection
| Parámetros | Tipo | Descripción | |
|---|---|---|---|
| Resultado | Collection | ← | Collection of objects describing the call chain within a process |
Historia
| Lanzamiento | Modificaciones |
|---|---|
| 20 R9 | Soporte de la propiedad formula |
Descripción
The Call chain command returns a collection of objects describing each step of the method call chain within the current process. Ofrece la misma información que la ventana Depurador. It has the added benefit of being able to be executed from any 4D environment, including compiled mode.
The command facilitates debugging by enabling the identification of the method or formula called, the component that called it, and the line number where the call was made. Each object in the returned collection contains the following properties:
| Propiedad | Tipo | Description | Ejemplo |
|---|---|---|---|
| database | Text | Name of the database calling the method (to distinguish host methods and component methods) | "database":"contactInfo" |
| formula | Text (si lo hay) | Contents of the current line of code at the current level of the call chain (raw text). Corresponde al contenido de la línea referenciada por la propiedad line en el archivo fuente indicado por el método. If the source code is not available, formula property is omitted (Undefined). | "var $stack:=Call chain" |
| línea | Integer | Número de línea de llamada al método | "line":6 |
| name | Text | Nombre del método llamado | "name":"On Load" |
| type | Text | Type of the method: | "type":"formMethod" |
Para que este comando pueda operar en modo compilado, la verificación de rango no debe estar deshabilitada.
Ejemplo
The following code returns a collection of objects containing information about the method call chain:
var $currentCallChain : Collection
$currentCallChain:=Call chain
If a project method is executed, the call chain could contain (for example):
[
{
"type":"projectMethod",
"name":"detailForm",
"line":1,
"database":"myDatabase"
}
]
If a form object method is executed, the call chain could contain (for example):
[
{
"type":"formObjectMethod",
"name":"detailForm.Button",
"line":1,
"database":"myDatabase"
},
{
"type":"formMethod",
"name":"detailForm",
"line":2,
"database":"myDatabase"
},
{
"type":"projectMethod",
"name":"showDetailForm",
"line":2,
"database":"myDatabase"
}
]
Propiedades
| Número de comando | 1662 |
| Hilo seguro | ✓ |