Usina BRAdvPL Guide
Sign in
← All topics
COMMANDUnder review

DEFINE DIALOG

DEFINE DIALOG oDlg TITLE cTitle FROM nTop,nLeft TO nBottom,nRight PIXEL

Defines a dialog before activating its interface.

DEFINE DIALOGAdvPL
01 · OVERVIEW

Overview

DEFINE DIALOG prepares the window; ACTIVATE DIALOG starts interaction. The official TTimer example shows this separation and pixel coordinates. TDialog documentation describes modal behavior and recommends MsDialog for Protheus applications. The syntax below is a teaching subset observed in examples, not every clause from every include. The authored example creates an empty window closable through its window control without reading or writing data. (TOTVS, n.d., refs. 1–2)

02 · SYNTAX

Syntax

DEFINE DIALOG oDlg TITLE cTitle FROM nTop,nLeft TO nBottom,nRight PIXEL

Parameters

oDlg
ObjectRequired

Variable receiving the dialog.

cTitle
CharacterRequired

Window title.

nTop,nLeft,nBottom,nRight
NumericRequired

Start and end coordinates; PIXEL defines the unit.

Return value

Command without a function return.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"
User Function Ed347()
    Local oDialog
    // Define first; activate once construction is ready.
    DEFINE DIALOG oDialog TITLE "Editorial example" FROM 0,0 TO 180,320 PIXEL
    ACTIVATE DIALOG oDialog CENTERED
Return Nil
Expected result

Centered empty window; no database operation. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Check include, lifecycle and SmartClient compatibility.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. TDialog. TDN. Accessed on 2026-10-26.
  2. TOTVS. TTimer. TDN. Accessed on 2026-10-26.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha