Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

Descend

Descend( cString ) --> cRet

Complements a string for descending-order keys.

DescendAdvPL
01 · OVERVIEW

Overview

Descend complements a string representation rather than sorting an array or reversing text. The reference requires a string and converts dates with DToS in its index example. A seek must apply the same transformation as the key. Documented Chr(0) remains Chr(0), enabling a check without displaying control characters. (TOTVS, n.d., ref. 1)

02 · SYNTAX

Syntax

Descend( cString ) --> cRet

Parameters

cString
CharacterRequired

String forming the key.

Return value

Complemented string.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed349()
    // Compare without printing the null character.
    ConOut(cValToChar(Descend(Chr(0)) == Chr(0)))
Return Nil
Expected result

True for the documented case. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Do not mix transformed keys and untransformed seek values.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. Descend. TDN. Accessed on 2026-10-26.
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