Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

Digito11

Digito11( cCalc, cDigito ) --> lRet

Compares a supplied check digit against a modulo-11 calculation.

Digito11AdvPL
01 · OVERVIEW

Overview

Although its title mentions calculation, the page documents Digito11(cCalc,cDigito) returning a comparison boolean rather than a generated numeric digit. The 2012 source covers older versions without detailing weights or algorithm exceptions; do not generalize it to every tax or banking document. The fragment requires base and digit defined by the specific contract without inventing an approved test pair. (TOTVS, n.d., ref. 1)

02 · SYNTAX

Syntax

Digito11( cCalc, cDigito ) --> lRet

Parameters

cCalc
CharacterRequired

Text base for calculation.

cDigito
CharacterRequired

Text digit to compare.

Return value

Logical comparison result.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed351()
    Local bValidate := {|cBase,cCheck| Digito11(cBase,cCheck)}
    // Callback prepared: supply a validated test pair before evaluation.
Return Nil
Expected result

Block prepared without validating a real number. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Verify application contract, format and check-digit rule.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

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