Skip to content

WCHR


Returns a wide-character string containing one or more Unicode characters

Syntax

` declare function Wchr ( byval ch as integer [, ... ] ) as wstring

`

Usage

` result = Wchr( ch0 [, ch1 ... chN ] )

`

Parameters

ch

The Unicode integer value of a character (up to 32 characters).

Return Value

Returns a wide-character string.

Description

Wchr returns a wide-character string containing the character(s) represented by the Unicode values passed to it.

When Wchr is used with numerical constants or literals, the result is evaluated at compile-time, so it can be used in variable initializers.

Not all Unicode characters can be displayed on any machine, the characters available depend on the font presently in use in the console. Graphics modes can't display Unicode characters, as the GfxLib built-in font is not Unicode.

Examples

start GeSHi

vb
Print "The character represented by the UNICODE code of 934 is: "; WChr(934)
Print "Multiple UNICODE characters: "; WChr(933, 934, 935)

end GeSHi

will produce the output:

The character represented by the UNICODE code of 934 is: Φ

Multiple UNICODE characters: ΥΦΧ

Platform Differences

  • DOS does not support Wchr.

Dialect Differences

  • Not available in the -lang qb dialect unless referenced with the alias __Wchr.

Differences from QB

  • New to FreeBASIC

See also

  • Chr
  • Wstr

Back to DocToc

Translated from FreeBASIC official docs. Contact us for removal if infringed.
FreeBASIC is an open-source project, not affiliated with Microsoft