Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

RetFileName

RetFileName( <cArquivo> )

Returns only the file name, without path and extension.

FilesStringUtility
01 · OVERVIEW

Overview

RetFileName() extracts only the file name from a string, ignoring both path and extension.

02 · SYNTAX

Syntax

RetFileName( <cArquivo> )

Parameters

cFile
CharacterRequired

File path and name to be analyzed.

03 · PRACTICAL EXAMPLE

Extracting the base name

#Include "TOTVS.ch"

User Function ExRetFileName()
    Local cArquivo := "\SIGAADV\ARQZZZ.DBF"

    MsgInfo(RetFileName(cArquivo)) // ARQZZZ
Return
Expected result

The return contains only the file name, without path and extension.

BEST PRACTICES
  • Use quando a rotina precisar identificar apenas o nome base do arquivo.
  • Para remover apenas a extensão mantendo o caminho, veja FileNoExt().

Related content

REFERENCES
  1. Help ADVPL.chm. Help AdvPL/APMSLib, documentação oficial histórica, 15 mar. 2004. Conteúdo resumido, reorganizado e marcado para revisão contra documentação atual da TOTVS quando disponível.
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