Usina BRAdvPL Guide
Sign in
← All topics
FOUNDATIONUnder review

Naming conventions and type prefixes

Uses names that reveal intent without confusing prefixes with typing.

Naming conventions and type prefixesAdvPL
01 · OVERVIEW

Overview

Prefixes such as c, n, d, l, a, b and o help readers recognize text, number, date, logical, array, block and object in team conventions. They neither declare types nor validate automatically. Combine a prefix with intent: nQuantity says more than nValue1. Preserve Protheus and external-contract identifiers; localizing author variables does not authorize renaming PARAMIXB or dictionary fields. Official good-practice guidance supplies the standardization context; the small example is an editorial proposal rather than a universal project convention. (TOTVS, n.d., ref. 1)

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"
User Function Ed315()
    Local cSummary := "Test"
    Local nQuantity := 2
    Local lValidated := .T.
    // Prefixes express intent without validating values.
    If lValidated
        ConOut(cSummary + ": " + cValToChar(nQuantity))
    EndIf
Return Nil
Expected result

Fictional summary with quantity 2. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Avoid ambiguous abbreviations and mid-flow type changes. Document API or legacy naming exceptions.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. Guia de Boas Práticas - ADVPL. 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