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.

INSTRUCTOR NOTES 20NAMES, CLOCKS AND MODESThis lesson treats the rules for naming variables, the "jiffy" clock and the edit and RUNmodes.Descriptive variable names help clarify programs but they take more typing and thereare two hidden "gottcha's." One is that BASIC records only the first two letters of aname. This means that those beautiful descriptive names may not be unique. Evenexperienced programmers occasionally get caught here, and the bug may be quite hardto detect. One "cure" is to use only one and two character names.The other gottcha is that "reserved words" may not be included in the name anywhere:start, middle or end. The reserved words are the BASIC commands and functions and arelisted in an appendix to this book. If a name contains a reserved word the computer prints9SYNTAX ERROR IN XXwhere XX is the line number containing the illegal name.The jiffy clock is a register in the computer which contains a six digit decimal number.The number is incremented every l/60th of a second. The number is in a BASIC variablebox named TI. A real clock (hours, minutes and seconds) is described in a later lesson.The student has been entering lines in the "edit mode" from Lesson 1 on, and has beenRUNning programs. Now we explain a little about the difference, and point out how theedit mode treats lines entered into the line buffer. The lesson on debugging makesextensive use of the edit mode options.QUESTIONS:1. Names longer than two characters may give you trouble. Why?2. Names which have numbers in them may be good names or wrong names. How canyou tell if they are good?3. Names cannot have punctuation marks in them, except in one case. What punctuationmark is allowed, where do you put it, and what does it tell you?4. Long names may not have "reserved words" at the front, inside, or at the back. Whichwords are "reserved"? Where is there a list of reserved words?5. How do you ask the jiffy clock "what time is it"?6. How does the jiffy clock differ from ordinary clocks?115

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

Saved successfully!

Ooh no, something went wrong!