CHR$ function

Purpose: CHR$ returns a string which contains the character[s] corresponding to the ASCII code integer parameter[s] which must have a value between 0 and 255. Up to 10 comma separated ASCII code integers can form the function parameter list.


 Syntax:

 RetStr$ = CHR$(ASCode1, [ASCode2, ... ASCode10])

 Parameters:

  • RetStr$ String which contains the character[s] corresponding to the ASCII code integer arguments[s].
  • ASCode1 [OPTIONAL] parameter containing ASCII code integer[s]. Up to 10 comma separated ASCII code integers can form the ASCode1 parameter argument list.

Example 1 :


 A$ = CHR$(65)          '  A$ will contain "A"

Example 2 :


 A$ = CHR$(65,66,67,68) '  A$  will contain "ABCD"

Remarks: BCX's implementation allows up to ten(10) integer OPTIONAL ARGUMENTS. ASC is a function complementary to CHR$. ASC returns the ASCII integer value when given a character argument.

BCX Console Sample Programs using CHR$ function.

S05.bas S16.bas, S41.bas, S42.bas, S53.bas, S54.bas, S66.bas, S82.bas, S103.bas, S108.bas, S110.bas, S113.bas, S119.bas, S128.bas, S132.bas