Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

IndexOrd

IndexOrd() -> nOrder

Reads the current index position in the open list.

IndexOrdAdvPL
01 · OVERVIEW

Overview

Returns a numeric position and zero when the current table has no open index. Position depends on opened indexes rather than being a universal dictionary identifier. Aliased expressions can inspect a specific area without permanently changing the caller’s selection. (Sources: refs. 1–1.) The community positioning example also illustrates GetArea/RestArea and explicit index selection; it does not determine the order in every environment.

02 · SYNTAX

Syntax

IndexOrd() -> nOrder

Return value

Numeric current-order position.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed487()
    // Read only, without creating or changing indexes.
    If !Empty(Alias())
        ConOut(cValToChar(IndexOrd()))
    EndIf
Return Nil
Expected result

Displays current-area metadata when an area is open. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Do not macro-execute untrusted expression text. Check the effective order before DbSeek.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. IndexOrd. TDN. Accessed on 2026-10-27.
  2. Daniel Atilio. zIndPos.prw; commit 7d275a7. Accessed on 2026-10-27.
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