Navigation:  thinBasic Modules > Core > String handling >

CHR$

Previous pageReturn to chapter overviewNext page

 

Description

 

Convert one or more ASCII codes, ranges, and/or strings into a single string containing the corresponding ASCII character(s).

 

Syntax

 

s = CHR$(expression [,expression] [,...])

s = CHR$(StringExpression [,...])

s = CHR$(expression TO expression [,...])

 

Returns

 

String

 

Parameters

 

Name

Type

Optional

Meaning









 

Remarks

 

Restrictions

 

See also

 

String Handling, ASC,

 

Examples

 

Script example

S = CHR$("Line1", 13, 10, "Line2")

S = "Line1" + CHR$(13) + CHR$(10) + "Line2"

S = "Line1" + CRLF + "Line2"

S = CHR$(0 TO 131, 97, 133 TO 255)

 

Thanks to Abraxas for the following script example

' Return ASCII character from a number

 

Dim MyNumbers(11) As Byte VALUE = 72, 101, 108, 108, 111, 32, 87, 111 , 114, 108, 100

Dim sMsg As String

Dim n    As Byte

 

For n = 1 To UBound(Mynumbers) ' UBOUND() returns the size of the array

  sMsg += CHR$(myNumbers(n))

Next

 

MSGBOX 0, sMsg

 

 

© 2004-2008 thinBasic. All rights reserved. Version 1.7.0.0 Web Site: http://www.thinbasic.com