Freedom Entertainment - Forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
HomePortalLatest imagesSearchRegisterLog in

 

 Your really first program!

Go down 
2 posters
AuthorMessage
RawR...
Freedom Entertainment - Owner & Founder
Freedom Entertainment - Owner & Founder
RawR...


Aantal berichten : 100
Registratiedatum : 2009-07-03
Leeftijd : 29
Woonplaats : http://freedoment.tk

Your really first program! Empty
PostSubject: Your really first program!   Your really first program! I_icon_minitime5/15/2010, 04:30

Helow beginner Coderz,

In this tutorial im going to show you how to code your really first program, we are going to use the language
"Basic", wich is a really easy to understand language for everyone and it's great to start with.
I very recommend to learn Basic before you get started with anoter language like C, C#, C++.
If you have any questions or things you do not understand please ask me for help. I work with the same structure
as always, i'll tell you wat we're going to do, show you an example, and explain the example. All i can say, let's start!

Note : Make sure you've got an compiler to test your codes, i recommend "Free Basic" wich is free and ez to use.
You can download Free Basic here : Download

1.Save Your Program:
So you want to make your own program, sounds interesting. Well, the first thing we're going to do
is write a little code, in notepad. This is what we're going to code:

Code:

CLS
PRINT "Hello, this is my first program"
END

2.What does it means?
Let's start with our first rule, if we take a look at our first rule we see "CLS". CLS is a default command wich
makes your screen empty. Next, our second rule, we see "PRINT". PRINT is another default command wich
provide text on your screen. And then our last rule, "END". Quess what? it means the end of the program.

3.Test your Program!
GoodJob, sir. You coded your first program Very Happy. Now you probaly want to see, the result? Open up, your
notepad file, and click on "File">"Save As..."C Drive">test.bas>All Files. Important to save your file, correctly.
What i always, do is i save it on my C drive becuz the C Drive is easy to reach, then i give my file a name, i call
it test, but on the end of the name i type in = ".bas" , i do this beceause this will change my txt file to a bas file. Now
to prevent my file will be a txt file, i say save the file as all files, after that im ready to save my file and the save file
part is done.

4.Run your Program!
Open up, Free Basic , and type in the following code ; "fbc -lang qb C:\test.bas" ( without those "" ) , run the
test.exe and there you go, your first program congratulations!

5.A little addon to you script
It's cool, you've just made your own program, but it's not really amazing or something, thats why we're now
going to add a little thing to your script. Open up notepad and type this in ;

Code:

CLS
INPUT "He you, enter you name! ", b$
PRINT "Did you just enter "; b$; " ? That's a beautifull name!"
END

Ok so CLS makes your screen empty, A new command is INPUT shows "He you, enter your name!" and
beceause of the INPUT command the user is able to type in his/her name into the variable b$. b$ is a variable
that saves the letters the user types in. You can type any name you want for the variable just as long it ends with $
We alrdy know what the PRINT command means, it just shows you that sentence between the "", after the user has
type in his or her name. And END wich close the program. We type " ; ; " beceause this will add the 3 text parts on the 3th rule togheter as one sentence if you don't add these " ; ; " your program wont run proper, and might crash.

6.Finish!
Goodjob, you just finished your first lesson Basic. It wasn't that hard right? Stay tuned for the next Basic tutorial
for more info you can leave a comment below, but do not send me personal mesages about this thread. Becuz, i'll
see that as spam, and i'll auto delete those mesages. Good luck and maybe you can play a little bit with the scipts.
Back to top Go down
https://freedoment.board-directory.net
Myth




Aantal berichten : 4
Registratiedatum : 2010-05-15

Your really first program! Empty
PostSubject: Re: Your really first program!   Your really first program! I_icon_minitime5/15/2010, 14:35

Thanks im downloading basic right now Smile Im gonna test it * its my first time * xd
Back to top Go down
RawR...
Freedom Entertainment - Owner & Founder
Freedom Entertainment - Owner & Founder
RawR...


Aantal berichten : 100
Registratiedatum : 2009-07-03
Leeftijd : 29
Woonplaats : http://freedoment.tk

Your really first program! Empty
PostSubject: Re: Your really first program!   Your really first program! I_icon_minitime5/15/2010, 14:46

Myth wrote:
Thanks im downloading basic right now Smile Im gonna test it * its my first time * xd

Haha, good luck then!
Back to top Go down
https://freedoment.board-directory.net
Sponsored content





Your really first program! Empty
PostSubject: Re: Your really first program!   Your really first program! I_icon_minitime

Back to top Go down
 
Your really first program!
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Freedom Entertainment - Forums :: Computer Language :: Coderz Paradise :: Basic-
Jump to: