Cool Program tweak

BlitzPlus Forums/BlitzPlus Tutorials/Cool Program tweak

Hello, in this article I am going to show you a trick in BlitzBasic coding.
First off, BlitzBasic is a language used for making games.
Second of all, please do not
try to make a program using BlitzPlus it is not made for anything other than making games.

_______________________________________________
Now for the fun stuff ;)

Parts of this article:

Part 1: Intro
Part 2: The program
Part 3: How the program works
Part End: Last of article

------------------------Part 1-------------------------

Introduction to BlitzPlus/Basic


Hello, BlitzBasic is a very, very easy to understand language. I am almost positive you will follow along but if you don't please go to Part 3 for a step by step guide to this tutorial. Okay now it is very easy to learn BlitzBasic, all you have to do to print 'Hello World' is this


Print "Hello World"
delay 5000


Now wasn't that easy if not just hang on I will tell you about it in Part 3.

--------------------------Part 2------------------------

The Program.


;pass.exe - password protect

AppTitle "passbox"
;asks user the pass
hehe = Input$("What is the password? ")

;var
lol = 11514251514
ha$ = "'http://somesite.org'"

;looks to see if pass was right
.password
If hehe = lol Then
Print "correct!"
Delay 500
Print "your link is " + ha + "!"
Delay 50000
End


;tells user to guess again
Else
Print "You have 3 trys left!"
Print ""
hehe = Input$("What is the password? ")
Goto password1
EndIf

;looks to see if pass was right
.password1
If hehe = lol Then
Print "correct!"
Delay 500
Print "your link is " + ha + "!"
Delay 50000
End

;askes user to guess again
Else
Print "You have 2 trys left!"
Print ""
hehe = Input$("What is the password? ")
Goto password2
EndIf

;looks to see if pass was right
.password2
If hehe = lol Then
Print "correct!"
Delay 500
Print "your link is " + ha + "!"
Delay 50000
End

;askes user to guess again
Else
Print "You have 1 try left!"
Print ""
hehe = Input$("What is the password? ")
Goto passwordend
EndIf

;looks to see if pass was right
.passwordend
If hehe = lol Then
Print "correct!"
Delay 500
Print "your link is " + ha + "!"
Delay 50000
End

;tells user he can't guess any more
Else
Print "You have 0 trys left!"
Delay 250
Print "This will end in 2.5 seconds"
EndIf

;waits 2.5 seconds, then ends
Delay 2500
End

-----------------------Part 3--------------------------

How passbox.exe works


' ; ' means this comment

' print ' means print text

' input$ ' means type something (in numbers)

' lol ' this is a variable

' ha$ ' this is a variable

' delay ' means how many milliseconds go by before it goes to the next command.

' goto ' Never use this!

' hehe ' this names the the line as in
hehe = Input$("What is the password? ")

' .sometext ' this names the block

' apptitle ' names the application

' end ' ends program instantly

' if ' this is what happens if condition is true

' else ' this is what happens when condition is false

' endif ' ends the if...else loop


-----------------------Part End------------------------

Last of this article

I hope you liked it.

Your beggining statement is very blunt, and narrow-minded
BlitzPlus' GUI capabilities can be used for bolth game's and
program's. Nice explaining though, I can't say I agree with the
beggining.

What the print "hello world" thing or hehe=input$?

P.S. This post wasn't really made for this site but I decided to put it here any ways.

[code]
[/code]
or
[codebox]
[/codebox]

"Second of all, please do not
try to make a program using BlitzPlus it is not made for anything other than making games. "

Huh? You can do plenty with BlitzPlus. Even more when you include DLL's. I am currently writing an app for a robotics project in Blitz and its coming along great :)

I have already been able to send and receive messages to/from the PC and bot via rs-232. I have accessed the bots ultrasonic range finders, GPS unit and tri axel accellerometer. I am also using the Blitz Virtual Machine to the allow the user to run scripts within my Blitz application that control the robot.

Blitz has the primary responsibility of providing a GUI, running the script, coordinating communications and storing and displaying the maps and GPS Coords.

Sure, having a degree in Software Applications Programming helps, but you can definately make more than games with Blitz!