Difference between revisions of "Legacy:CreateStringFromCode"

From Spherical
Jump to: navigation, search
(created from http://web.archive.org/web/20110802033529/http://www.spheredev.org/wiki/CreateStringFromCode)
 
(No difference)

Latest revision as of 22:38, 1 June 2013

This function returns a string corresponding to the ASCII code number inputted.

Usage

string CreateStringFromCode(integer);


  • number integer. The ASCII index number of the character to be returned. Eg: 65 is 'A'

Examples

var string = CreateStringFromCode(65);
font.drawText(0, 0, "The first letter of the alphabet is " + string);
FlipScreen();
GetKey();

Notes

The CreateStringFromCode function is not a commonly used function, but in special cases, it may be useful. Note that the JavaScript specification includes a similar function, String.fromCharCode which acts the same way but supports multiple arguments.

API:Script/navbox