Usina BRAdvPL Guide
Sign in
NÍVEL 1 · FOUNDATIONS

What AdvPL is and where it is used

Learn about the language, its place in Protheus, and the path from a source file to execution.

Without signing in, progress is saved in this browser.

Objectives

Learn about the language, its place in Protheus, and the path from a source file to execution.

  • explain what AdvPL is
  • identify its relationship with Protheus
  • recognize common development scenarios
  • distinguish source, compilation, repository, and execution

Origins and evolution

AdvPL stands for Advanced Protheus Language. It evolved from Microsiga’s experience with xBase technologies and the need to preserve and extend Protheus business applications.

Historical sources identify different milestones for its evolution and formal release. The timeline is therefore best understood as a process.

From source to execution

.prw sourceFile written by the developer.
CompilationValidates and transforms the code.
RepositoryStores compiled objects.
AppServerLoads and executes routines.
ProtheusMakes the routine available in the application context.

Where it is used

Business rulesCompany-specific calculations, validations, and decisions.
Records and queriesAdding, updating, and searching information.
Entry pointsControlled customization of product behavior.
Data and reportsQueries, processing, reports, and spreadsheets.
InterfacesDialogs, messages, browses, and visual components.
IntegrationsREST services, JSON, and communication with other systems.

First contact with code

This example introduces a user function, a local variable, a message call, and the end of the routine.

#Include "TOTVS.ch"\n\nUser Function HelloAdvPL()\n    Local cMessage := "Hello! This is my first contact with AdvPL."\n\n    MsgInfo(cMessage, "AdvPL Training")\nReturn

Practical activity

Change the message to include your name and state that you started AdvPL training. Then compare it with the suggested solution.

Knowledge check

1. What does AdvPL stand for?
2. Which component executes compiled routines?
3. Where are compiled objects stored?
4. What is a common use of AdvPL?
5. What does User Function declare?

Lesson completed! You earned “First contact with AdvPL”.

Back to the learning path →

References

  1. MICROSIGA. Programação em ADVPL Completo. Educação Corporativa, 2009.
  2. SILVA, Waterloo Ferreira da. A Linguagem AdvPL. 2004, p. 11.
  3. TOTVS. AdvPL. TDN.