Saltar para o conteúdo principal
Versão: 20 R9 BETA

Call chain

Call chain : Collection

ParâmetroTipoDescrição
ResultadoCollectionCollection of objects describing the call chain within a process
História
ReleaseMudanças
20 R9Support of formula property

Descrição

The Call chain command returns a collection of objects describing each step of the method call chain within the current process. It provides the same information as the Debugger window. 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:

PropriedadeTipoDescriptionExemplo
databaseTextName of the database calling the method (to distinguish host methods and component methods)"database":"contactInfo"
formulaTexto (se houver)Contents of the current line of code at the current level of the call chain (raw text). Corresponds to the contents of the line referenced by the line property in the source file indicated by method. If the source code is not available, formula property is omitted (Undefined)."var $stack:=Call chain"
linhaIntegerLine number of call to the method"line":6
nameTtextName of the called method"name":"On Load"
typeTextType of the method:
  • "projectMethod"
  • "formObjectMethod"
  • "formmethod"
  • "databaseMethod"
  • "triggerMethod"
  • "executeOnServer" (when calling a project method with the Execute on Server attribute)
  • "executeFormula" (when executing a formula via PROCESS 4D TAGS or the evaluation of a formula in a 4D Write Pro document)
  • "classFunction"
  • "formMethod"
  • "type":"formMethod"
    nota

    For this command to be able to operate in compiled mode, the Range checking must not be disabled.

    Exemplo

    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"
    }
    ]

    Propriedades

    Command number1662
    Thread safe