hello world basic tutorial nova southeastern university cristal locke this presentation is...
TRANSCRIPT
Hello World
Basic TutorialNova Southeastern UniversityCristal Locke
This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved.
Obtaining the Software
True Basic Bronze 5.41a can be purchased on-line for $39.00 from www.truebasic.com. The compiler includes a 250 page guide for True Basic Bronze.
Brief History of BASIC
In 1964, John G. Kemeny and Thomas E. Kurtz, Professors of Mathematics at Dartmouth University, developed Beginner’s All Purpose Symbolic Instruction Code (BASIC). The language was created for the General Electric 225, and it was meant to be simple to learn, easy to translate, and a stepping stone for learning more powerful languages.
John Kemeny
Thomas Kurtz
In 1974, Bill Gates, a student at Harvard University, and Paul Allen, an employee at Honeywell, developed a Basic language for MITS’ Altair, the first personal computer. MITS liked the product and it was licensed to the company by Mr. Gates and Mr. Allen. The success of the language encouraged the businessmen to take their product to Seattle, where they attended grade school together. By the late 1970’s, Apple, Commodore, and Atari were supporting Basic.
Paul Allen
In the mid 1980’s, Mr. Gates developed a DOS-Basic interpreter. There was an IBM-DOS version called BASICA, which was distributed with all IBM computers, and a MS-DOS version called GW-DOS, which ran on any machine that ran DOS. The two programs were not very different.
Bill Gates, Microsoft Chairman
In the late 1980’s, Tim Button, Product Manager at Microsoft, led a team that developed QuickBasic. The updated language allowed users to code programs that ran without an interpreter. This version was distributed and upgraded continuously until it reached version 4.5. At that time, Microsoft developed Professional Development System Basic (PDS Basic), which continued upgrading until version 7.1 (also known as Quick Basic Extended). Microsoft was successful in its use of graphical user interfaces (GUI’s) and this led to the development of Visual Basic for DOS and Windows. Visual Basic became very successful in 1991 when version 2.0 was released. Version 3.0 became the fasted growing compiler in the market.
Before you begin to install, make sure that you exit all windows programs that are currently
running.
Installing the Software
1. Place the disk into the CD-Rom drive (in many cases it is the D drive, however this may vary depending on the computer you are using).
2. Sometimes the program will begin the installation process on its own. If this happens, skip steps 3, 4, & 5. Instead, go to step 6.
3. Double click on My Computer on your desktop
4. Double click on the BRONZE icon, which should be the same icon as your CD-ROM drive.
5. Double click on setup.exe.
6. A blue screen will appear advising of copyright laws. Read the information and click next.
7. The next screen gives you an opportunity to change the directory in which you wish to save the program. Click on the Next button to continue.
8. True Basic will create a folder for you and place the program in your Program Folder. Click Next to continue.
9. Click on Next to continue.
10. Setup will run, which installs the program to your computer.
11. When setup is complete, click on the Close button.
Starting the Program
1. Click on the Start button on the lower left hand side of your screen.
2. Go to Programs, then to True Basic Bronze Edition, and finally click on TB Bronze.
3. The program will begin and a screen will appear like the one below.
Setting up Your Compiler1. Click on New.
2. Click on File and Save and type helloworld.exe in the File name window. Click Save.
Hello World Program
1. Type the following into your Helloworld.exe window:
REM Hello WorldPRINT "Hello World!"PRINTPRINT "This is my 1st Basic program."PRINTPRINT "I used True Basic, which is a Windows
based program."END
2. Click on Run and then Run from the menu at the top of the screen.
3. Your first program will run on a DOS based screen.
4. In order to exit the program, hit any key.
Saving Your Program
After all of that work, I have to assume you want to save your
work of art!
Saving your work is important so that you will not have to start over
when you return.
1. Click on File and then Save from the menu at the top of the screen.
2. Click on File and Close to close your creation.
Samples
The following slides are small programs created to show some common commands used in BASIC.
In order to use the samples, click on New and type the data in the box. Don’t forget to save your program!
INPUT and PRINT Commands
PRINT "What is the length of the rectangle."INPUT lengthPRINTPRINT "What is the width of the rectangle"INPUT widthPRINTPRINT "Length", "Width", "Area"PRINT length, width, length*widthEND
GOTO Command
60 PRINT "Please type a value for X."70 INPUT x80 IF x > 3 THEN GOTO 6090 IF x < 3 THEN GOTO 100100 PRINT "You're done"110 END
FOR NEXT Command
FOR I = 1 to 20PRINT I;NEXT IPRINTFOR I = 20 TO 1 STEP - 1PRINT INEXT IEND
IF THEN Command
PRINT "Please type a value for X."INPUT xPRINTPRINT "Please type a value for Y."INPUT yPRINT IF x = y THEN PRINT "x = y The numbers are the same"IF x < y THEN PRINT "x < y The second number is greater than the first number"IF x > y THEN PRINT "x > y The first number is greater than the second number"END
Learn MoreTrue Basic has a
built in tutorial that can be
accessed from the Help for True BASIC dropdown menu at the top of the screen.
The tutorial can be used to answer any
questions that may arise about
commands, functions, menus, or
statements.
True Basic Bronze, Edition Guide is included with the purchase of the compiler. This book is an excellent resource that includes an appendix with an alphabetical listing of statements, built-in functions, and error message explanations.
Kemeny, J. & Kurtz, T. (2002). True BASIC bronze edition guide. Hartford: True BASIC, Inc. ISBN: 0-939553-39-2
Contact Information
Cristal Locke can be contacted through e-mail at [email protected] or through
http://tucker.dade.k12.fl.us/classrooms/Locke/gifted.htm
This tutorial was created on August 5, 2002.
Permissions
Permission is hereby given to Nova Southeastern University students, who are taking WebCT courses, to use this presentation.
Cristal Locke, August 5, 2002