nPosField position starting at 1.
AdvPL GuideField( nPos ) --> cRetGets a field name by ordinal position.
Field starts at position 1, excludes internal Recno/Deleted fields and behaves like FieldName. Positions beyond field count return empty text; an absent work area can raise a recoverable error. The community example uses a fixed SA1 position. The adaptation checks field availability before inspecting the first field without assuming its name. EDTRB is an already-open owned test alias; ED_COD, when used, is a length-10 character field in the teaching schema. (TOTVS, n.d., ref. 1)
Field( nPos ) --> cRetnPosField position starting at 1.
Field name or empty string in documented cases.
#Include "Protheus.ch"
User Function Ed382()
If Select("EDTRB") > 0
// The schema field count may differ from a sample.
If EDTRB->(FCount()) > 0
ConOut(EDTRB->(Field(1)))
EndIf
EndIf
Return NilFirst owned-schema field name rather than its value. 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.