Nigma, I'll do my best to help you at least look into whether or not programming is something you will be interested in.
First, every one has a BASIC interpreter on their computer, if they are running some version of Windows. I can run you through a little lesson of sorts using it.
Open a DOS shell (Window). At the C:> prompt type in QBASIC. This is basically an editor, but it is specifically for BASIC. It will recognize BASIC keywords and automatically capitalize them for you. It also has help for all the BASIC keyword and data types built in! Very helpful program.
To begin with select the Options menu and then select Display... under that. Change Tab setting to something useful like 3 or 4. Eight is too large for any real nesting of statements. You only need to do this once as the value should be saved for next time.
BASIC is a top-down programming language (if you do not count Visual Basic) meaning that instructions are executed in order starting at the top and going down, unless the instructions cause the program flow to change (ie. skip lines, conditional statments, goto). Pretty straight foward, I hope.
Please feel free to post any questions you have and I'll try to answer them as simply as I can.
Let's write a small little program in the editor.
1) We need to define any variables we use. Care must be taken because BASIC (some versions) do not alert you to typos, it just assumes it must be a new variable. If you are using a variable named "wages", but you accidentally spell it as "wags" in one place, BASIC will just think you have two variables and you will have to find the problem on your own! QBASIC does this...
Type in the first line as follows and press enter. If the words "DIM", "AS" and "INTEGER" capitalize it is correct.
<BLOCKQUOTE><font size="1" face="Tahoma, Arial, Helvetica">code:</font><HR><pre>dim i as integer[/code]
This tells the QBASIC interpreter to dimension, or save room for, an integer by the name of "i" which is a common loop index variable.
2) Now we need to get the computer to do something simple. Let's print your name a few times on the screen.
<BLOCKQUOTE><font size="1" face="Tahoma, Arial, Helvetica">code:</font><HR><pre>
CLS
FOR i = 1 TO 10
PRINT "Nigma"
NEXT i
END
[/code]
Type each line in lower case so you can tell if it is correct when the words capitalize as I have shown above.
You can move you cursor to the line that reads CLS and press F1. You will get the syntax for using CLS and you will learn that CLS clears the screen.
The next code is a "FOR" loop that will loop 10 times and execute everything it finds until the NEXT command is hit. In this case it will print your name and then loop back to the top repeating 10 times.
Let's see how it works. Using the RUN menu select Start or press SHIFT+F5 and the program will run and you will see the following:
Nigma
Nigma
.
.
.
Nigma
Nigma
Okay, that is it... simple huh?
Exercise 1) Using help for PRINT determine what adding the ";" and "," to the end of the PRINT line do to the program.
Exercise 2) Look up help for the keyword LOCATE and see if you can print your name starting at line 5 instead of line 1.
I'll think about what we will do next....
------------------
I declare myself to be the self-annointed voice of reason for PuF! Opinions expressed by Taskmaster are not necessarily those of Planet Unreal! /~unreal/ubb/html/smile.gif
[This message has been edited by Taskmaster (edited 02-23-2000).]
[This message has been edited by Taskmaster (edited 02-23-2000).]
First, every one has a BASIC interpreter on their computer, if they are running some version of Windows. I can run you through a little lesson of sorts using it.
Open a DOS shell (Window). At the C:> prompt type in QBASIC. This is basically an editor, but it is specifically for BASIC. It will recognize BASIC keywords and automatically capitalize them for you. It also has help for all the BASIC keyword and data types built in! Very helpful program.
To begin with select the Options menu and then select Display... under that. Change Tab setting to something useful like 3 or 4. Eight is too large for any real nesting of statements. You only need to do this once as the value should be saved for next time.
BASIC is a top-down programming language (if you do not count Visual Basic) meaning that instructions are executed in order starting at the top and going down, unless the instructions cause the program flow to change (ie. skip lines, conditional statments, goto). Pretty straight foward, I hope.
Please feel free to post any questions you have and I'll try to answer them as simply as I can.
Let's write a small little program in the editor.
1) We need to define any variables we use. Care must be taken because BASIC (some versions) do not alert you to typos, it just assumes it must be a new variable. If you are using a variable named "wages", but you accidentally spell it as "wags" in one place, BASIC will just think you have two variables and you will have to find the problem on your own! QBASIC does this...
Type in the first line as follows and press enter. If the words "DIM", "AS" and "INTEGER" capitalize it is correct.
<BLOCKQUOTE><font size="1" face="Tahoma, Arial, Helvetica">code:</font><HR><pre>dim i as integer[/code]
This tells the QBASIC interpreter to dimension, or save room for, an integer by the name of "i" which is a common loop index variable.
2) Now we need to get the computer to do something simple. Let's print your name a few times on the screen.
<BLOCKQUOTE><font size="1" face="Tahoma, Arial, Helvetica">code:</font><HR><pre>
CLS
FOR i = 1 TO 10
PRINT "Nigma"
NEXT i
END
[/code]
Type each line in lower case so you can tell if it is correct when the words capitalize as I have shown above.
You can move you cursor to the line that reads CLS and press F1. You will get the syntax for using CLS and you will learn that CLS clears the screen.
The next code is a "FOR" loop that will loop 10 times and execute everything it finds until the NEXT command is hit. In this case it will print your name and then loop back to the top repeating 10 times.
Let's see how it works. Using the RUN menu select Start or press SHIFT+F5 and the program will run and you will see the following:
Nigma
Nigma
.
.
.
Nigma
Nigma
Okay, that is it... simple huh?
Exercise 1) Using help for PRINT determine what adding the ";" and "," to the end of the PRINT line do to the program.
Exercise 2) Look up help for the keyword LOCATE and see if you can print your name starting at line 5 instead of line 1.
I'll think about what we will do next....
------------------
I declare myself to be the self-annointed voice of reason for PuF! Opinions expressed by Taskmaster are not necessarily those of Planet Unreal! /~unreal/ubb/html/smile.gif
[This message has been edited by Taskmaster (edited 02-23-2000).]
[This message has been edited by Taskmaster (edited 02-23-2000).]