Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
FreeBASIC
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Example code== Standard programs, such as the [["Hello, World!" program]] are done just as they were in QuickBASIC. <syntaxhighlight lang="qbasic"> Print "Hello, World!" sleep:end 'Comment, prevents the program window from closing instantly </syntaxhighlight> FreeBASIC adds to this with support for [[object-oriented programming|object-oriented]] features such as [[Method (computer programming)|methods]], [[constructor (object-oriented programming)|constructors]], [[Memory management#DYNAMIC|dynamic memory allocation]], [[property (programming)|properties]] and temporary allocation. <syntaxhighlight lang="vbnet" highlight="1,11"> Type Vector Private: x As Integer y As Integer Public: Declare Constructor (nX As Integer = 0, nY As Integer = 0) Declare Property getX As Integer Declare Property getY As Integer End Type Constructor Vector (nX As Integer, nY As Integer) x = nX y = nY End Constructor Property Vector.getX As Integer Return x End Property Property Vector.getY As Integer Return y End Property </syntaxhighlight> <syntaxhighlight lang="vbnet"> Dim As Vector Ptr player = New Vector() *player = Type<Vector>(100, 100) Print player->getX Print player->getY Delete player Sleep 'Prevents the program window from closing instantly </syntaxhighlight> In both cases, the language is well suited for learning purposes.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)