Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

MSRename

MsRename(cArqOrig,cArqDest) -> lOk

Renames a file through the current RDD.

MSRenameAdvPL
01 · OVERVIEW

Overview

The historical reference takes source and destination filenames/extensions and returns logical success. It does not rename an open alias or change a dictionary’s logical name. Path scope and restrictions depend on RDD and environment. The historical documentation does not establish unrestricted table-renaming support across DBMSs. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

MsRename(cArqOrig,cArqDest) -> lOk

Parameters

cArqOrig
CharacterRequired

Source file with extension.

cArqDest
CharacterRequired

New filename with extension.

Return value

Logical: .T. if the operation succeeds.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed550()
    // Block not invoked; use only owned, closed test files.
    Local bRename := {|cSource,cDest| MsRename(cSource,cDest)}
    ConOut(ValType(bRename))
Return Nil
Expected result

Prints B. Renaming is not executed. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Check source, unused destination, permissions, RDD and index dependencies before evaluation. Handle failure without assuming destination creation.
  • 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. 360. 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