.bmx to executable

BlitzMax Forums/BlitzMax Beginners Area/.bmx to executable

Repentless(Posted 2007) [#1]
Hiya :)

I'm a noobie to BlitzMax and I've been having trouble figuring out how to turn my code into an executable program I can distribute.

Here is my first bit of code:

[CODE]
firstname$ = "Gilbert"
lastname$ = "Gregg"
age = 16

Print "Hello! My name is " + firstname$ + " " + lastname$ + "!"
Print "I am " + age + " years old."
Print "I have " + (18 - age) + " years left until I turn 18."
Delay 2000
Print "That's the end of me!"
[/CODE]

How do I turn this into an executable file?

Thanks.


TomToad(Posted 2007) [#2]
Just click the little rocket icon. It will create an executable in whichever directory the source is saved.


Repentless(Posted 2007) [#3]
Thanks :)

Now, this is what I have in my code:

[CODE]
Graphics 800,600

firstname$ = "Gilbert"
lastname$ = "Gregg"
age = 16

Print "Hello! My name is " + firstname$ + " " + lastname$ + "!"
Print "I am " + age + " years old."
Print "I have " + (18 - age) + " years left until I turn 18."
Delay 10000
Print "That's the end of me!"
[/CODE]

However, whenever I try to run my program, I get a message about my color scheme being switched to Windows Vista Basic and the program locks up. It this just because Vista is gay as usual?


Brucey(Posted 2007) [#4]
Does it appear to lock up for about 166 seconds ?

Some tips...

If you aren't doing anything "graphicsy", you don't need the first line. The "Print" statements will output to the console.

If you want the text to appear on the graphics window, you will need to use - DrawText "sometext", x, y

How's about :
Graphics 800,600

firstname$ = "Gilbert"
lastname$ = "Gregg"
age = 16

DrawText "Hello! My name is " + firstname$ + " " + lastname$ + "!", 100, 200
DrawText "I am " + age + " years old.", 100, 220
DrawText "I have " + (18 - age) + " years left until I turn 18.", 100, 240

Flip
WaitKey

Print "That's the end of me!"


I suggest you also look into using "Strict" or "SuperStrict", which turns on lots of compile-time error checking and other useful things to help catch basic coding errors.


Repentless(Posted 2007) [#5]
I understand everything there except "Flip" and "WaitKey" - what do they do?


tonyg(Posted 2007) [#6]
Highlight them each in turn in your IDE and press F1 twice. That'll display their documentation.
Basically, flip switches the hidden 'background' screen where all the drawing is done to the front so it is visible.
Waitkey...errrr.... waits for a key to be pressed.


Repentless(Posted 2007) [#7]
Ah, got it :) So basically, "That's the end of me!" will display and the program will end after any key has been pressed, if I understand correctly.


tonyg(Posted 2007) [#8]
Yep, exactly.