Usina BRAdvPL Guide
Sign in
← All topics
COMMANDPublished

@ ... SAY

@ <nRow>, <nCol> SAY [<oSay> PROMPT | VAR] <cText> [PICTURE <cPict>] [OF <oWnd>] [FONT <oFont>] [COLORS <nClrText>, <nClrBack>] [SIZE <nWidth>, <nHeight>] [HTML] [PIXEL]

Creates a TSay component for displaying text, labels and formatted values in the interface.

Visual interfaceSAYTSayTextLabelsCommands
01 · OVERVIEW

Overview

The @ ... SAY command displays a character expression in a dialog, panel, folder or other visual component. During compilation it is translated into the TSay class New() constructor. Text may use a PICTURE mask, custom font and colors and, when HTML is supplied, supported markup may be interpreted instead of displayed literally.

02 · SYNTAX

Syntax

@ <nRow>, <nCol> SAY [<oSay> PROMPT | VAR] <cText> [PICTURE <cPict>] [OF <oWnd>] [FONT <oFont>] [COLORS <nClrText>, <nClrBack>] [SIZE <nWidth>, <nHeight>] [HTML] [PIXEL]

Parameters

nRow, nCol
NuméricoRequired

Row and column where the text is placed. With PIXEL, coordinates start at the upper-left corner of the parent.

oSay PROMPT / VAR
ObjetoOptional

Variable receiving the TSay object. When supplied, PROMPT or VAR must precede the displayed expression.

cText
CaractereRequired

Constant or variable character expression whose content is displayed.

PICTURE cPict
CaractereOptional

Mask used to format the displayed content.

OF oWnd
ObjetoOptional

Dialog, panel, folder or other container that owns the component. OF is recommended.

FONT oFont
ObjetoOptional

TFont object used to display the text.

COLOR / COLORS nClrText, nClrBack
NuméricoOptional

Text color and, optionally, background color.

SIZE nWidth, nHeight
NuméricoOptional

Width and height reserved for the text.

HTML
CláusulaOptional

Causes supported HTML markup to be interpreted instead of shown literally.

PIXEL / PIXELS
CláusulaOptional

Indicates pixel coordinates; prefer PIXEL for consistency.

03 · PRACTICAL EXAMPLE

Label and formatted value

#Include "TOTVS.ch"

User Function ExSayValue()
    Local oDlg
    Local oSayTotal
    Local nTotal := 1520.75

    Define Dialog oDlg Title "Order summary" ;
        From 100, 100 To 240, 520 Pixel

    @ 20, 20 Say "Total:" Size 45, 12 Of oDlg Pixel
    @ 20, 70 Say oSayTotal Prompt nTotal ;
        Picture "@E 999,999.99" Size 100, 12 ;
        Colors CLR_BLUE, CLR_WHITE Of oDlg Pixel

    Activate Dialog oDlg Centered
Return
Expected result

The first SAY is a label; the second retains its object and displays a masked value with custom colors.

04 · PRACTICAL EXAMPLE

Text inside a panel

#Include "TOTVS.ch"

User Function ExSayPanel()
    Local oDlg
    Local oPanel
    Local oFonte

    Define Dialog oDlg Title "Situação" ;
        From 0, 0 To 200, 460 Pixel

    oFonte := TFont():New("Arial",, -16, .T.)

    @ 10, 15 MsPanel oPanel Prompt "Processamento" ;
        Size 190, 55 Of oDlg Raised

    @ 18, 15 Say "Processamento concluído" ;
        Size 150, 14 Font oFonte ;
        Colors CLR_GREEN, CLR_WHITE Of oPanel Pixel

    Activate Dialog oDlg Centered
Return
Expected result

OF oPanel makes SAY a child of the panel and its coordinates become relative to it.

BEST PRACTICES
  • Include TOTVS.ch to make the command available to the compiler.
  • Use SAY as a field label or to display non-editable information.
  • Use oSay PROMPT when properties or the object must be updated later.
  • Apply PICTURE for formatted display such as currency or dates.
  • Size the component for fonts, translations and potentially longer text.
  • Prefer OF to explicitly identify the owner container.
  • Use HTML only when formatting is necessary and the environment is compatible.
COMMON PITFALLS
  • When an object is supplied, omitting PROMPT or VAR makes the declaration invalid.
  • A PICTURE incompatible with the content may display it incorrectly.
  • Translated text may exceed a fixed width; reserve space or adapt layout by language.
  • HTML built from untrusted input may produce unexpected formatting; validate and escape embedded data.
  • Without OF, the component is bound to the active window or dialog.
  • Mixing PIXEL with another unit may cause misalignment.

Related content

REFERENCES
  1. TOTVS. @ ... SAY. TDN. Created by Julio Wittwer; last changed on May 29, 2019.
  2. TOTVS. TSay — constructors for the class used by the command. TDN.
  3. TOTVS. AdvPL formatting pictures. TDN.
  4. eADVPL Reference Guide. No author identified, created July 28, 2005. Related section: p. 13. Historical reference; syntax checked primarily against a current source.
Status
Published
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR