Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

IsDigit

IsDigit(cString) -> lResult

Checks whether the first character is between 0 and 9.

IsDigitAdvPL
01 · OVERVIEW

Overview

Only the first character is examined. IsDigit("1A") is true even though the entire string is not a valid number. The official note mentions Val, but this does not make the function a complete validator for numeric format, signs, separators or decimals. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

IsDigit(cString) -> lResult

Parameters

cString
CharacterRequired

String to analyze.

Return value

Logical result about the first character.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed495()
    // Only the first character is checked.
    ConOut(IsDigit("1A"))
    ConOut(IsDigit("A1"))
Return Nil
Expected result

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

BEST PRACTICES
  • For whole-string validation, define the expected grammar and handle empty input, spaces and encoding explicitly.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

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