The First Step
Before you can program you must have
freebasic and an editor to develop in.
If you dont have freebasic, you can
find it here:
You should download an editor named
jellyfishpro or jfishpro for short.
You can also download fbide or fbedit.
The freebasic site should cover this.
Now that you have the tools you need
we can start setting up. Open jfish pro
and click compile THEN click set compiler
defaults. THEN change the top bar to
wherever you installed freebasic(fbc.exe).
Time To Program
Time to do the obligatory "hello world"
program. Open jfish pro and THEN click new.
Type or copy/paste this
Print "hello world"
Now press f5 or click
compile THEN build/execute.
sleep can also be changed to
any number measured in milli-
seconds. This next program will
Print "c: dos"
Print "c: dos run"
Print "c: dos run boy run"
This next code demonstrates using
for/next to execute a statement 20 times
Be sure to set compiler for -lang qb for
the next few examples.
Dim a As Single
For a= 1 To 20 Step 1
Print "You've Been Owned"
Now we will look at doing some loops.
This code loops ten times as it adds
1 to itself. Thus counting to ten.
Dim a As Integer
a = a+1
Loop Until a = 10
Ok, now lets start doing something
useful. This next code checks the
system time and functions like an
a$ = Time
If a$ = "11:05:00" Then
Loop Until 0
Change "11:05:00" to two minutes in the
future and compile the program. In two
minutes, the cmd shell will display the
system time. Well that was fun, but lemme'
explain that last code. Dim means "dimension"
it just lets the computer know you're about
put data into a "string" just like algebra ie
e=mc^2. where e holds the energy data and m holds
the mass data and so on. So now why is there a $?
That simply means you're going to input data that
is not a number. We have to use that because ":"
is not a number. Gosub means goto a subroutine ie
goto "alarm:" and the return to the next line.
"GOTO" would have worked as well but generally
GOSUB is better to use.
Now lets get some user input.......
Input "What is your name"; a$
Print a$; " is a stupid name!!!!"
Input "*Sigh* Now what do you want"; b$
Print "I dont care about "; b$
Now you know the basics of freebasic/qbasic!!