cCaractereParameter used by the function. Check the Portuguese source page for the detailed original wording while this entry remains under review.
AdvPL GuideRat( <cCaractere>, <cString> )Returns the last position of one text inside another string.
Returns the last position of one text inside another string. This page was created from the historical training material and structured for quick reference, with practical notes and cautious use in current Protheus environments.
Rat( <cCaractere>, <cString> )cCaractereParameter used by the function. Check the Portuguese source page for the detailed original wording while this entry remains under review.
cStringParameter used by the function. Check the Portuguese source page for the detailed original wording while this entry remains under review.
User Function ExRat()
Local cFile := "final.report.pdf"
Local nDot := Rat(".", cFile)
If nDot > 0
MsgInfo("Extension: " + SubStr(cFile, nDot + 1))
EndIf
ReturnRat() finds the last dot and allows extracting the pdf extension.
© 2026 Usina.BR. All rights reserved. TOTVS, Protheus, Microsiga and their respective logos are trademarks of their owners. AdvPL Guide is independent and uses limited, attributed excerpts justified by educational purposes. See the Terms of Use. Terms of Use
Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.