Chr: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Brendon (talk | contribs)
No edit summary
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
''This function is for BASIC compatibility. It is not available in pure JavaScript projects.''
Chr(''number'')
Chr(''number'')


Line 5: Line 7:
Chr returns the equivalent character of an ANSI character code. The required expression, ''number'', is any numeric expression.
Chr returns the equivalent character of an ANSI character code. The required expression, ''number'', is any numeric expression.


== Example ==
== Example (Basic) ==


<pre>
<pre>
REM Chr Example
Rem Chr Example
'Chr returns characters from numbers
'Chr returns characters from numbers
DIM Lowercase, Uppercase
 
Dim Lowercase, Uppercase
Lowercase = Chr(97)
Lowercase = Chr(97)
Uppercase = Chr(97 - 32)
Uppercase = Chr(97 - 32)
PRINT "Lowercase = " & Lowercase
Print "Lowercase = " & Lowercase
PRINT "Uppercase = " & Uppercase
Print "Uppercase = " & Uppercase
</pre>
</pre>


Line 26: Line 29:
== Related Items ==
== Related Items ==


[[asc|ASC]]
[[asc|Asc]]


[[Category:Language Reference]]
[[Category:Language Reference]]
[[Category:Strings]]
[[Category:BASIC Functions]]

Latest revision as of 15:20, 25 March 2019

This function is for BASIC compatibility. It is not available in pure JavaScript projects.

Chr(number)

Description

Chr returns the equivalent character of an ANSI character code. The required expression, number, is any numeric expression.

Example (Basic)

Rem Chr Example
'Chr returns characters from numbers

Dim Lowercase, Uppercase
Lowercase = Chr(97)
Uppercase = Chr(97 - 32)
Print "Lowercase = " & Lowercase
Print "Uppercase = " & Uppercase

Output

Lowercase = a
Uppercase = A

Related Items

Asc