Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

MSErase

MsErase(cArquivo,[cIndice],[cDriver]) -> lOk

Removes a data artifact through its driver.

MSEraseAdvPL
01 · OVERVIEW

Overview

Depending on the RDD, the target can be a file or table. This is not logical deletion of a record through D_E_L_E_T_. Index and driver are optional; the default driver is current. Restrict removal to test artifacts owned by the routine. Historical reference: verify behavior in the deployed release/RDD. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

MsErase(cArquivo,[cIndice],[cDriver]) -> lOk

Parameters

cArquivo
CharacterRequired

Artifact to remove.

cIndice
CharacterOptional

Index according to driver.

cDriver
CharacterOptional

RDD driver.

Return value

Logical result of the documented operation.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed538()
    // Block not invoked; supply only authorized test artifacts.
    Local bOperation := {|cDest,cIndex,cRDD| MsErase(cDest,cIndex,cRDD)}
    ConOut(ValType(bOperation))
Return Nil
Expected result

Prints B. The operation is not executed; check its logical result when integrating. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Check RDD, connection, path and destination ownership. Handle failures, collisions and open resources. This fragment is not a production backup or migration procedure.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. Waterloo Ferreira da Silva. AdvPL — O Manual, versão 1.0, p. 358. Referência histórica. 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