xParamValue whose type is to be identified.
AdvPL GuideValType( <xParam> ) --> cRetIdentifies the type of the supplied value.
ValType receives a value and returns a character code: A for array, B for code block, C for character, D for date, L for logical, N for numeric, O for object and U for undefined/Nil. The reference also lists F for fixed-point decimal; verify environment availability. Unlike Type, it does not receive an expression string. Type checking does not validate array length, contents or object properties. (Ref. 1)
ValType( <xParam> ) --> cRetxParamValue whose type is to be identified.
Character identifying the value type.
#Include "TOTVS.ch"
User Function EdTipo()
Local uValue := Nil
// Nil is a value stored in the variable, with code U.
ConOut(ValType(uValue))
uValue := {"A", "B"}
If ValType(uValue) == "A"
// The type does not establish the element count.
ConOut(cValToChar(Len(uValue)))
EndIf
Return NilExpected results: U and 2. The variable exists from its declaration. 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.