Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

IndRegua

IndRegua(cAlias,cIndice,cExpress,[xOrdem],[cFor],[cMens],[lExibir])

Creates a filtered temporary index in the historical model.

IndReguaAdvPL
01 · OVERVIEW

Overview

The manual describes alias, index file, expression, optional order, filter, message and display flag. xOrder D indicates descending. This historical contract depends on the RDD and is not permanent SQL index creation. The example only prepares a block for an alias and exclusive test index name. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

IndRegua(cAlias,cIndice,cExpress,[xOrdem],[cFor],[cMens],[lExibir])

Parameters

cAlias
CharacterOptional

Work-table alias.

cIndice
CharacterRequired

Exclusive test index filename.

cExpress
CharacterRequired

Key expression.

xOrdem
CharacterOptional

D for descending according to the manual.

cFor
CharacterOptional

Filter expression.

cMens
CharacterOptional

Progress message.

lExibir
LogicalOptional

Controls progress display.

Return value

NIL according to the historical manual signature.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed488()
    // ED_COD must exist in the prepared work table.
    Local bIndex := {|cAlias,cIndex| IndRegua(cAlias,cIndex,"ED_COD",,"!Empty(ED_COD)",,.F.)}
    ConOut(ValType(bIndex))
Return Nil
Expected result

No index is created until explicit block invocation. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Define index opening, selection, closure and disposal within the temporary-table lifecycle; check TOPCONN behavior.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. Waterloo Ferreira da Silva. AdvPL — O Manual, versão 1.0; p. 352. Referência histórica. 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