{{htmlmetatags>metatag-robots=() metatag-title=(ASCII CODE | ugBASIC User Manual) metatag-keywords=(ugBASIC,Commodore 64,Commodore PLUS/4,ZX Spectrum) metatag-description=(Manual page for ASCII CODE) metatag-media-og:image=(:ugbasic:logo-ugbasic-fb.png) metatag-og:title=(ASCII CODE | ugBASIC User Manual) metatag-og:description=(Manual page for ASCII CODE) }} ====== ugBASIC User Manual ====== ===== ASCII CODE ===== ===== SYNTAX ===== = ASCII CODE ==== PURPOSE ==== The ''ASCII CODE'' command capture a keystroke "on the Fly", and return the equivalent ASCII code instead of internal ''SCANCODE''. This command is a fundamental tool for making programs more interactive. It allows you to read a character typed by the user without having to press the enter key. Unlike other input commands, ''ASCII CODE'' does not require the user to press Enter to send the character, while the typed character is not displayed on the screen. It return directly the ASCII code of the typed character, or a special value (0) if no key was pressed. It is equivalent to write ''ASC( INKEY$() )'', but faster, since no string is created. Note that the reading speed could vary significantly depending on the target. This command allows you to create simple games in which the user must press specific keys to control a character or object. It can be used to create more responsive user interfaces, in which the user can interact with the program in real time or that respond to certain key combinations, automating certain operations. Due to the limitations of 7-bit ASCII encoding, ''ASCII CODE'' could only read characters in the standard ASCII set. Use ''SCANCODE'' if you need to be able to detect any key. ==== EXAMPLE ==== IF ASCII CODE = 42 THEN PRINT "ASTERISK has been pressed!" ENDIF ==== ABBREVIATION ==== AsciiCo ==== AVAILABLE ON ==== ==== SEE ALSO ==== [[SCANCODE]] ==== ALIAS FOR ==== [[ASCIICODE]] ==== ANY PROBLEM? ==== If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please [[https://github.com/spotlessmind1975/ugbasic/issues/new?title=ISSUE ON ASCII CODE|open an issue]] for this keyword on GitHub. Thank you!===== POWERED BY ===== [[:ugbasic:user:index|{{ :ugbasic:user:logo-ugbasic.png?nolink&600 |}}]]