home *** CD-ROM | disk | FTP | other *** search
/ Futura 5 / Futura_Issue_05_1993_01_NOSAUG_Side_A_BASIC.atr / basic4.doc < prev    next >
Text File  |  2023-02-26  |  5KB  |  1 lines

  1. Inside Atari Basic (Part 4)¢by Bill Carris¢¢¢MORE KEY INFORMATION¢¢The Magic of the CONTROL Key¢¢    Once you learn how to use the CONTROL key you can really get control of your computer display.  The CONTROL key is always held down while pressing another key.  For instant gratification, hold down the CONTROL key and press the [2] key.¢¢    This section is going to concentrate on using the CONTROL key for editing programs and changing your screen display.  Remember, when you see [CONTROL] you should hold the control key while pressing the other key.¢¢    Use the following steps in order to:¢¢A. Move the cursor (screen marker) without changing the text on the screen.¢¢B. Insert and delete words and spaces.¢¢¢(1) Start by typing a program line.¢¢        10 PRINT "HELLO JOHN"¢¢(2) Now press the following... [CONTROL] [-] until you have put the cursor back on top of the 1.¢¢(3) Now press [CONTROL] and hold the [*] key down until the cursor is on the top of the J in JOHN.  If you went too far you can use [CONTROL] [+] to back up or keep going with [CONTROL] [*] and let the cursor wrap around the screen.  Notice that your program line remains intact.  It would have been wiped out if you had not been holding the [CONTROL] key down.¢¢(4) Release  the [CONTROL] key when making your changes.  With the cursor on top of the J, take your finger off the [CONTROL] key and change JOHN to MARY.  Press [RETURN] and the change is completed.¢¢(5) Now, use the [CONTROL] and arrow keys as before only this time stop between HELLO and MARY.¢¢(6) Press the [CONTROL] and the [INSERT] key on the top row of the keyboard.  Spread the words out by inserting spaces - even down to the next line if you want.  You can hold [CONTROL] and [INSERT] down to insert a lot of spaces.¢¢(7) Press the space bar once and type the word you want to insert. ¢¢ e.g. 10 PRINT "HELLO TYPHOID   MARY"¢¢(8) Holding down [CONTROL] and using the [DELETE BACK SPACE] key will bring MARY back to TYPHOID.¢¢(9) Don't forget to press [RETURN] or the changes won't be made in the computer's memory.¢¢¢    Using the [CONTROL] and [DELETE BACK SPACE] keys can be very absorbing.  Try this...¢¢Use [CONTROL] and the [-] and [*] keys to place the cursor on top of the T in line 10.¢¢Now press [CONTROL] [DELETE BACK SPACE] and watch TYPHOID being absorbed into the cursor.¢¢If you don't press [RETURN] after you have made your changes then only the screen display will change and not the program line in the computer's memory.  If you press [RETURN] you will get rid of the TYPHOID in MARY forever.¢¢¢FINAL ADVICE:  You're probably going to make a few mistakes as you get control of the [CONTROL] key.  For instance, you may accidentally press [CONTROL] [CLEAR] instead of [CONTROL] [INSERT].  But after some practice, you will really appreciate these screen editing features.¢¢¢¢¢VARIABLES¢¢    A variable is anything that can change or vary.  Here are some familiar variables:¢¢- A musical note;¢- The colour of a TV screen;¢- The price of gold;¢- Your age;¢- The rate of inflation.¢¢    When using the computer, we usually assign variables names to help us remember what they stand for and to work with them.  The price of gold might be called GOLDPRICE or GPRICE or PRICE or GOLD or G or BANANAPRICE.  The computer could care less what you call it.¢¢HINT: Don't leave any spaces in the variable name.  GOLDPRICE not GOLD PRICE.¢¢    After we have a name, we need a value for the variable.¢¢LET GOLDPRICE=395.63¢¢This would tell the computer to give the variable called GOLDPRICE a value of 395.63.¢¢    Now, tell it to PRINT GOLDPRICE and it will give you a value of 395.63.¢¢NOTE: The LET is optional.  GOLDPRICE=395.63 is sufficient.¢¢ALSO NOTE: The computer starts out giving a value of zero (0) to all variables.¢¢TYPE THIS: PRINT ZONK - It will show you that ZONK is 0 until you tell the computer otherwise.¢¢¢THERE ARE TWO KINDS OF VARIABLES:¢¢¢Numeric Variables¢¢You put numbers in numeric variables:¢¢GOLDPRICE=395.63¢AGE=22¢SPEED=120¢¢¢String Variables¢¢You put words or characters in these:¢¢NAME$="JOHN DOE"¢MONTH$="MAY"¢PLACE$="EGYPT"¢A$="NANCY"¢¢The $ is simply a way of telling the computer that it is a STRING VARIABLE, not a numeric.¢¢¢TWO IMPORTANT THINGS ABOUT STRING VARIABLES¢¢1. You MUST first tell the computer how many spaces to reserve for your string variable.  This is done with a DIMENSION statement.  It goes like this:¢¢           10 DIM NAME$(8)¢¢This means that you can have as many as eight characters in your name.  "BOB" would fit.  "BETTY" would be fine".  "FRANZ SCHUBERT" would be unfinished.¢¢¢2. The other important thing is to remember to put QUOTES around your STRINGS.¢¢10 DIM A$(20)¢20 LET A$="FRANZ SCHUBERT"¢30 PRINT A$¢¢¢¢End of part 4.¢¢Inside Atari Basic by Bill Carris,¢Reston Publishing Company, 1983.¢¢Conversion to DOC files by S.J.Murray,¢North Of Scotland Atari User Group.¢