ASCII: Difference between revisions

m
→‎Control Codes: Double spaced for better readability
m (formatting, removed extra whitespace at the top)
m (→‎Control Codes: Double spaced for better readability)
Line 6:
 
* 0: (<code>NUL</code>). This is probably one of the most important codes of all. This marks the end of a text string, or other various data fields. Without it, your typical "putS" (Print String) routine would go on forever and eventually crash! Computers don't understand the concept of the end of a data range natively, and often rely on NUL to know when to stop reading. (Some languages place the string size as metadata before the actual string itself, but others use a null terminator)
 
 
* 7: Bell (<code>BEL</code>). The computer makes a beeping sound when reading this control code.
 
 
* 8: Backspace (<code>BS</code>). This will delete the character placed before the cursor.
 
 
* 9: Horizontal Tab (<code>HT</code>). This is your Tab key.
 
 
* 10: Line Feed (<code>LF</code>). This causes the text cursor to move down to the next line, but its horizontal position is unchanged. The phrase "line feed" is also from typewriters, where turning the knob would <i>feed</i> more paper through the carriage. ASCII 13 followed by ASCII 10 makes up a "new line" command (aka <code>\n</code> in [[C]])
 
 
* 13: Carriage Return (<code>CR</code>). This causes the text cursor to go back to the far-left side of the screen (in the days of ASCII, computers weren't designed for languages other than English, so this assumed you were writing left to right. The term "carriage return" comes from typewriters, when pressing the "return" key would make the <i>carriage</i> (the cylinder that held the paper) slide back to the left.
 
 
* 27: <code>ESC</code>. This is the Escape key!
1,489

edits