[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'db' (#fcl)

# TField.IsValidChar

Check whether a character is valid input for the field

## Declaration

Source position: db.pas line 381

`public function TField.IsValidChar(`
`InputChar: Char`
`):Boolean; virtual;`

## Arguments

`InputChar` |  | Character to check

## Function result

True if InputChar is in the set ValidChars.

## Description

IsValidChar checks whether InputChar is a valid characters for the current field. It does this by checking whether InputChar is in the set of characters sepcified by the TField.ValidChars property. The ValidChars property will be initialized to a correct set of characters by descendent classes. For instance, a numerical field will only accept numerical characters and the sign and decimal separator characters.

Descendent classes can override this method to provide custom checks. The ValidChars property can be set to restrict the list of valid characters to a subset of what would normally be available.

## See also

TField.ValidChars |  | Characters that are valid input for the field's content

Documentation generated on: Feb 26 2014