Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

Min

Min(xExp1,xExp2) -> xResult

Returns the smaller of two numbers or dates.

MinAdvPL
01 · OVERVIEW

Overview

Arguments must be comparable and of the same type. The function chooses between two values; it does not scan an entire array. Numeric inputs keep this example independent of date settings. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

Min(xExp1,xExp2) -> xResult

Parameters

xExp1
Number or dateRequired

Comparable value of the same type as the other argument.

xExp2
Number or dateRequired

Comparable value of the same type as the other argument.

Return value

Selected value preserving its type.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed527()
    // Compare values of the same type.
    ConOut(cValToChar(Min(10,12)))
Return Nil
Expected result

Result: 10. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Validate types before calling and distinguish lower from upper bounds.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. Min. TDN. 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