11.07.2015 Views

Here - 1000 BiT

Here - 1000 BiT

Here - 1000 BiT

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

n INSTRUCTOR NOTES 23 SECRET WRITING AND THE GET COMMAND^ This lesson concerns the GET command.^ GET is a method of requesting a single character from the keyboard.^There is no screen display at all. No prompt or cursor is displayed, and the keystroke isnot echoed to the screen.O The utility of the GET command lies just in this fact. For example, a requested word maynbe received with a series of GETs without displaying it to bystanders.Another advantage over INPUT is that no RETURN key pressing is required. This^ makes GET useful in "user friendly" programming for menus and in games for^ moves, etc.r*\ When the GET command is executed, the computer looks into the line buffer for acharacter. If it finds one, it returns it to the variable. (If the variable is numeric and the^ keystroke was not, a ? SYNTAX ERROR is printed.)If the line buffer is empty, it returns zero to a numeric variable or "" (the empty string)^ to a string variable.O For most situations where you want to think, then press a key, you must put GET into aloop, and keep looking at the buffer until a non-empty string is present.^ The line buffer has a "queue" up to 10 characters long. So for some cases, you can "typeahead" up to 10 characters.nQUESTIONS:^ 1. Compare INPUT and GET. For each question reply "GET" or "INPUT".nna) Gets whole words and sentences at once.b) Shows a cursor.c) Gets one character at a time.^ d) Shows the keystrokes on the screen.C} e) Does not need a RETURN keypress.O 2. Why do you usually need to put GET into a short loop?n131

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!