Usina BRAdvPL Guide
Sign in
← All topics
FOUNDATIONUnder review

AdvPL language structure

Separates declaration, processing and return in a small routine.

AdvPL language structureAdvPL
01 · OVERVIEW

Overview

An AdvPL program groups routines with declarations, assignments, calls, directives, comments and control structures. PRW is a common source extension, not proof of RPO compilation. Indentation improves readability without replacing language delimiters. The example localizes its authored variable while keeping the same sequence: declare a fixed value, calculate and return. The include is an explicit environment dependency. (TOTVS, n.d., ref. 1)

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"
User Function Ed366()
    Local nQuantity := 3
    // Separate declaration and transformation for readability.
    nQuantity := nQuantity + 1
Return nQuantity
Expected result

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

BEST PRACTICES
  • Compile in the matching environment before considering the routine available.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. Estrutura da Linguagem. 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