cDtoValText containing a numeric value.
AdvPL GuideGetDToVal(cDtoVal) -> nRetExtracts a number from a string with mixed characters.
The reference describes digit extraction with decimal-point handling. Characters such as slashes are discarded and strings without digits return zero. Conversion does not consider negative numbers. Despite its name it does not convert dates, nor validate monetary or document-number formats. (Sources: refs. 1–1.)
GetDToVal(cDtoVal) -> nRetcDtoValText containing a numeric value.
Extracted number.
#Include "Protheus.ch"
User Function Ed466()
// Permissive extraction, not input validation.
ConOut(cValToChar(GetDToVal("1/2/3")))
ConOut(cValToChar(GetDToVal("abc")))
Return NilExpected numeric results: 123 and 0. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
© 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.