Character codes: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (Automated syntax highlighting fixup (second round - minor fixes)) |
No edit summary |
||
Line 956: | Line 956: | ||
println[char["Frink rules!"]] // prints [70, 114, 105, 110, 107, 32, 114, 117, 108, 101, 115, 33] |
println[char["Frink rules!"]] // prints [70, 114, 105, 110, 107, 32, 114, 117, 108, 101, 115, 33] |
||
println[[70, 114, 105, 110, 107, 32, 114, 117, 108, 101, 115, 33]] // prints "Frink rules!"</syntaxhighlight> |
println[[70, 114, 105, 110, 107, 32, 114, 117, 108, 101, 115, 33]] // prints "Frink rules!"</syntaxhighlight> |
||
⚫ | |||
<syntaxhighlight lang="futurebasic"> |
|||
print "a -> "; ASC("a") |
|||
print "98 -> "; CHR$(98) |
|||
handleevents |
|||
</syntaxhighlight> |
|||
{{output}} |
|||
<pre> |
|||
a -> 97 |
|||
98 -> b |
|||
</pre> |
|||
=={{header|Gambas}}== |
=={{header|Gambas}}== |
||
<syntaxhighlight lang="gambas">Public Sub Form_Open() |
<syntaxhighlight lang="gambas">Public Sub Form_Open() |
||
Line 972: | Line 988: | ||
ASCII code 35 represents # |
ASCII code 35 represents # |
||
</pre> |
</pre> |
||
⚫ | |||
{{header|GAP}}== |
|||
<syntaxhighlight lang="gap"># Code must be in 0 .. 255. |
<syntaxhighlight lang="gap"># Code must be in 0 .. 255. |
||
CharInt(65); |
CharInt(65); |
||
Line 978: | Line 996: | ||
IntChar('Z'); |
IntChar('Z'); |
||
# 90</syntaxhighlight> |
# 90</syntaxhighlight> |
||
=={{header|Go}}== |
=={{header|Go}}== |
||
In Go, a character literal ''is'' simply an integer constant of the character code: |
In Go, a character literal ''is'' simply an integer constant of the character code: |