Chr: Difference between revisions
Jump to navigation
Jump to search
Line 5: | Line 5: | ||
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) | ||
Line 15: | Line 16: | ||
Print "Lowercase = " & Lowercase | Print "Lowercase = " & Lowercase | ||
Print "Uppercase = " & Uppercase | Print "Uppercase = " & Uppercase | ||
</pre> | |||
== Example (JavaScript) == | |||
<pre> | |||
//Chr Example | |||
//Chr returns characters from numbers | |||
var Lowercase, Uppercase; | |||
Lowercase = Chr(97); | |||
Uppercase = Chr(97 - 32); | |||
NSB.Print("Lowercase = " + Lowercase); | |||
NSB.Print("Uppercase = " + Uppercase); | |||
</pre> | </pre> | ||
Revision as of 06:07, 1 May 2013
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
Example (JavaScript)
//Chr Example //Chr returns characters from numbers var Lowercase, Uppercase; Lowercase = Chr(97); Uppercase = Chr(97 - 32); NSB.Print("Lowercase = " + Lowercase); NSB.Print("Uppercase = " + Uppercase);
Output
Lowercase = a Uppercase = A