Usina BRAdvPL Guide
Sign in
← All topics
COMMANDUnder review

RESET ENVIRONMENT

RESET ENVIRONMENT [IN SERVER oEnvSrv]

Closes an environment owned by the routine.

RESET ENVIRONMENTAdvPL
01 · OVERVIEW

Overview

The analyzed public TBICONN.CH macro expands RESET ENVIRONMENT to RpcClearEnv; IN SERVER uses a remote call. This is evidence about that historical include, not proof of equivalence with the installed include. Environment closure is neither GetArea restoration nor a transaction rollback. RpcSetEnv documentation warns against closing menu-, REST PrepareIn- or Schedule-owned contexts. The exercise comments out the command to avoid closing the current context. (Sources: refs. 1–2.)

02 · SYNTAX

Syntax

RESET ENVIRONMENT [IN SERVER oEnvSrv]
03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"
#Include "TBICONN.ch"

User Function Ed618()
    // Execute only when closing an environment opened by this routine.
    // RESET ENVIRONMENT
    ConOut("RESET ENVIRONMENT")
Return Nil
Expected result

Displays the command name without executing it. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Verify the installed TBICONN.CH and cleanup on success/error. Do not install community includes as updates.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. imsys/Protheus-Include. include/tbiconn.ch. Macro pública analisada integralmente; não distribuída nem instalada. Accessed on 2026-10-27.
  2. TOTVS. RpcSetEnv: propriedade e encerramento do ambiente. Accessed on 2026-10-27.
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