Fandom

Petit Computer Wiki

CHR$ (Function)

914pages on
this wiki
Add New Page
Comments0 Share

V1Edit

Indications are, CHR$ in SmileBasic V1 is identical to that in V2.

V2Edit

CHR$(number) returns a single-character string, determined by number (after it has been rounded down, if it is a noninteger).

When number is between 32 and 126 inclusive, CHR$(number) gives the character indexed by that number in the ASCII table, except for CHR$(92), which gives the Yen symbol (¥). (ASCII character 92 is the backslash, which you can get from CHR$(127).)

When number is any other value between 0 and 255 inclusive, the character given is one of the other symbols available, determined by SmileBoom (see the Character Table).

If number is any other value, the system generates an error Out of range (CHR$).

The opposite of CHR$ is ASC; the result of ASC(CHR$(A)) is A (as long as it's an integer between 0 and 255 inclusive), and the result of CHR$(ASC(A$)) is the first character of A$ (as long as it's not empty).

V3Edit

Indications are, CHR$ in SmileBasic V3 is similar to that in V2, except the number is interpreted as a Unicode character number.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.