Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

TRANSFORM()

Transform(xValue,cPicture) -> cText

Formats an expression with a picture mask.

TRANSFORM()AdvPL
01 · OVERVIEW

Overview

Transform receives a scalar expression and picture and produces display text. It does not validate documents, authorization or financial calculations. This example uses @! for uppercase, avoiding decimal-separator dependence. Numeric pictures require width, rounding and configuration checks; TDN notes __SetPicture can affect @E. (Sources: refs. 1–2.)

02 · SYNTAX

Syntax

Transform(xValue,cPicture) -> cText

Parameters

xValue
ScalarRequired

Supported character, date, logical or numeric.

cPicture
CharacterRequired

Display picture.

Return value

Character.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed694()
    // Display mask, not content validation.
    ConOut(Transform("editing","@!"))
Return Nil
Expected result

Displays EDITING. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Do not parse formatted text back to a number without a format contract.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. Transform. Sintaxe e observações. TDN. Accessed on 2026-10-28.
  2. Atilio. dan-atilio/AdvPL. Maratona de Exemplos/Exemplo_503_Funcao_Transform.prw. Arquivo completo consultado; adaptação editorial. Accessed on 2026-10-28.
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