A "Hello World" Program
So, now it is time to start learning how to program in Liberty Basic. Traditionally the first program you write in a new language is a program to write "Hello World!" to the screen. So let's do that it Liberty Basic. The code goes something like this.
Now that wasn't hard was it? I was suprised to find that running this program brought up a default window with a textbox... I'm used to simple programs like this outputing to a console window. In some ways, it is kinda nice that a real window is brought up. I encourage you all (if you are learning to program Liberty Basic along with me) to try entering this example program and running it yourself. For those of you who are curious, this is what the output should look like... (click on the image to view the picture full size)
I hope you enjoyed.
Eddie
print "Hello World!"
end
Now that wasn't hard was it? I was suprised to find that running this program brought up a default window with a textbox... I'm used to simple programs like this outputing to a console window. In some ways, it is kinda nice that a real window is brought up. I encourage you all (if you are learning to program Liberty Basic along with me) to try entering this example program and running it yourself. For those of you who are curious, this is what the output should look like... (click on the image to view the picture full size)
Well, that's our first program written. I know it is possible to write programs that don't bring up this default window. I wonder if it is possible to bring up a console window instead (for those times when you actually want a console window). I'll leave this for another post though.
I hope you enjoyed.
Eddie
2 Comments:
A quick note on console access, current Liberty BASIC (v4.03) does not have native functions allowing direct access to stdin, stdout, or stderr.
By Anonymous, at 8:29 AM
That's a shame. Sometimes you want to write a quick program that can be run from the command line. Perhaps this will be addressed in future versions of Liberty Basic.
Thanks for the information.
Eddie
By Edward Meyer, at 9:08 AM
Post a Comment
<< Home