Basic Clock for BASIC Programmers
Read-Me


Requirements:
  • A TI-84+SE
  • A basic understanding of TI-OS BASIC
  • The Mirage OS App. (This should have came with your calculator. If you don't have it, you can download it from TICalc.org.)

    I have created this program for people wanting to learn BASIC. The included HTML manual just goes over a few things of BASIC, so don't expect this program to tell you everything you need to know for BASIC. This program is actually a really nice clock. It is plain and simple on your home screen, but it is always correct. Never behind or ahead a second. But just make sure that you set your time correctly first on your TI-84+SE! (This program will not work without this type of calculator.) I hope that you will enjoy this program. And keep a look-out for my future programs that are in BASIC, but are really fun and effective!

    After you have sent BSCCLOCK to your calculator, press [APPS] then scroll down until you have found MirageOS. Open it up and press the 2nd/Enter button to open your main folder. You will see a file called BSCCLOCK. You can press enter to open it. Once the program is done running, it will exit back to Mirage OS. (Press Clear to exit the program.)

    Now to explaining the code. Press the [PRGM] button, press the right arrow button, and then find the file called BSCCLOCK. Press enter. You should see a lot of BASIC code. That is okay if you have no idea what any of this means. That is why I created this program. On the first line you will see something that looks like this - :"Basic Clock. Now why did I put another semi-colon? Well, if you remember, this program is in Mirage OS and in order for it to be in this application, there is a code you have to write on the first line of a BASIC program. This line is the "description" for this program. (Description- the line of information at the bottom of the screen when BSCCLOCK is hi-lighted in Mirage OS.) You can only put one quote. If you put another one at the end of this line, this feature will not work.

    Now for the second line of code. This line simply states - ClrHome. This command is pretty self-explanatory, but if you do not know what it does - it clears the home screen. You use this command so your program will be the only thing on the screen. :)

    The third line of code says - 9->dim(LCLOK. This command you might not be familiar with. This command simply creates a list called CLOK. "dim(" stands for dimensions. Since there is no list called CLOK on your calculator, this command creates it. You are saying that there should be nine entry spaces to enter in data in this list called CLOK. (The common dimension for a list is 9, but if you need more space, you can always increase this number to however much space you need.) Now you have a list.

    This next line just says - Lbl 1. This just means that all of the code after this command is part of Lbl 1 until you get to the command that says stop. On the next line after Lbl 1 it says getkey->L. This command gets the key that you pressed and stores it to the variable L. Each key on your calculator is special (believe it or not). It has its own code. For example, the clear button's code is 45. The enter button's code is 105. It really benefits you to know each button's code in BASIC programming because you will use getKey commands a lot.

    On the next line it says - If L=45:Goto QT. This line means if the number stored in variable "L" is equal to 45, then "Goto" lable QT. Like I said earlier, the clear button's code is 45. So if you press the clear button, then you will jump to Lable QT without going through all of the other code first. If there is no button pressed, then the program will just ignore this line and keep going to the next line which says...

    getTime->LCLOK. This command gets the current time and stores it to the list CLOK. There are three pieces of data to time. What do you see first when you look at a clock? The hour. What do you see second when you look at a clock? The minute. And clocks that have this, what do you see third? The seconds. Well that is the order of the data in list CLOK.

    On the next three lines, you see some data from list CLOK being stored to some variables. On the first line it says LCLOK(1)->H. This is taking the first piece of data in list CLOK and storing it to the variable H. We know that we see the hour first on a clock, so we know that whatever number is stored in H, that is the hour. Same for the next line, except that it is storing the minutes into variable M and same for the next line.

    Now it is time for a real life example! Say we run the "getTime" command and store it to list CLOK. The calculator is getting the current hour and then putting it on the top of the list. Then the calculator looks and sees the minutes and puts it on the second spot on the list. Then it finds the seconds and stores it to the third spot on the list. So if the time was 2 hours and 11 minutes and 15 seconds, then it stored it to that list, the data on that list would look like this: {2 11 15}.

    These next few lines are just looking at the time and seeing that if the hours has two digits, then move it back a spot to make it look good. So let me explain it all to you. The first line says if H (which is the hours if you don't remember) is less than ten, then store 6 to variable Q. Why number 6? Well, we'll explain that later. When it finds if the variable is greater than 9, it is seeing if it is two digits. And same thing with the less than 10. Now it says when S is equal to zero, clear the home screen, the seconds are going from a two-digit number (59) to a one-digit number (zero) and would be displayed as 09 for the seconds. Well, it isn't zero-nine seconds, so we need to clear the screen so it will be just the zero in the seconds place.

    Now for putting the time on the screen! The main part! You should see something that says "Output(4,Q,H" on your screen. Now what the heck does that mean? It is just displaying your hours on the screen. The four and the Q are the coordinates for H. If you remember, on the lines above it said if the hour is two digits then five store to Q. The four in this output goes down four rows. The Q in this output goes across five/six columns. If there is two digits, then Q will go back a column so it will look good. Same with all of the other variables for the next display stuff. Now why did we put Output(4,7,":? Well, we wanted there to be a seperater between the hours and minutes, so we put that there. Same with the seperater between the minutes and seconds. Now after all of the confusing displays, we see something that says...

    Goto 1. Now if you remember well, we put a label on line four of this code called label 1. The command Goto 1 simply jumps to label one. This is what makes this clock tick. If it wasn't for this loop, (A loop is something that continues indefinitely in a program until stopped by another piece of code.) then the time will just be the same. Time keeps going, so we want this program to keep going with the time. It goes back to label one and runs all of this code again. If you haven't noticed, time changes. So there are more than likely going to be different numbers in the different variables therefore causing the time to change when it is displayed on the screen. During label one this also gets the key press again. If you only got the key press once, most people won't press something in that quick of a time that this piece of code runs, so we want this to keep checking to see if we have pressed clear yet. Once we finally press clear, it immediately goes to Label QT.

    Label QT is really simple. The reason I called this label QT is because it is short for quit and you can only have one or two letters or numbers for a label. (You can also combine letters and numbers to make a label such as A1.) As you should already be familiar with this next command, it says ClrHome which clears the home screen. If you have ever ran a BASIC program before, it usually says Done on the home screen of your calculator when it is done running. I, personally, do not like the message. It makes your program look messy which you don't want. So in order to get rid of that message, and yes there is a way, you just put one quotation mark on the last line of code. So in order for that to be on the last line, you have to put the quit label at the end of the code. If you were to put the quit label at the beginning, it would still jump to that label when you pressed clear, but there would be a Done message. So you have to put that at the very last line.

    Well that is about it for this program. If you have anymore questions at all, you can email me at ti_geek@yahoo.com. And please, no flames. I hope that you enjoyed this program and also this read-me/how-to guide for this BASIC program. If you have any suggestions about how I could make this program even better or any ideas for another BASIC program and manual like this one, then please email me. Oh and one last thing - when you email me, please put Basic Clock in the subject. Thank you so much for downloading this program!

    Drew Hanberry
    ti_geek@yahoo.com