I've read a lot about this...freebasic. I must say, this may be what I've been unconsciously looking (aka, the urge to program qbasic with the limitations and weak processing power).
I'm curious though. I see a lot of functionality has been added to the basic language with freebasic, but does it support TYPE SUBS and FUNCTIONS. More commonly know as Objects, in turn, Object Oriented Programming??
-Exodus
FreeBASIC
Object Oriented Programming itself, not yet. Or so I was told.
Simply dealing with objects is not what Object Oriented Programming is about. A very common mistake.
Rather dealing with Classes, Virtual Functions, and PolyMorphism. That's what makes Object Oriented Programming, OOP. Otherwise even C could do OOP. Which, it can't.
Simply dealing with objects is not what Object Oriented Programming is about. A very common mistake.
Rather dealing with Classes, Virtual Functions, and PolyMorphism. That's what makes Object Oriented Programming, OOP. Otherwise even C could do OOP. Which, it can't.
Later days,
Matthew
May those who love us love us
And those who don't
May the good Lord turn their hearts
And if he doesn't
May he turn their ankles
So we'll know them by their limping
-Irish prayer
Matthew
May those who love us love us
And those who don't
May the good Lord turn their hearts
And if he doesn't
May he turn their ankles
So we'll know them by their limping
-Irish prayer
Perhaps I wasn't clear enough
I ment functions and sub that are specific to a custom TYPE variable...Object Oriented Programming
Example
Do I make more sense?
Example
Code: Select all
TYPE Album
name AS STRING
caption AS STRING
FUNCTION set_data(n$, c$)
END TYPE
FUNCTION set_data(n$, c$) ' "this" is used because the function
this->name = n$ ' is specific to the variable declared
this->caption = c$ ' as type Album.
END FUNCTION
so..
DIM MyAlbum AS Album
MyAlbum.set_data("my name", "my caption")
or
MyAlbum->set_data("my name", "my caption")
Thanks Levi. You answered my question as I was clearifying my question.
Perhaps this could come to be known as simple OOP or, BASIC OOP. I would very much love to see an implementation of such a concept in FreeBASIC....
I think I've spoken too much
-Exodus.
This is what how I have come to understand as OOP. However I suppose my question delt with OOP "commonly misunderstood." Simply, manipulating a TYPE's variable with TYPE specific functions.Levi wrote:Rather dealing with Classes, Virtual Functions, and PolyMorphism. That's what makes Object Oriented Programming, OOP.
Perhaps this could come to be known as simple OOP or, BASIC OOP. I would very much love to see an implementation of such a concept in FreeBASIC....
I think I've spoken too much
-Exodus.
Re: Perhaps I wasn't clear enough
Can be emulated using Funk pointers.Exodus wrote:I ment functions and sub that are specific to a custom TYPE variable...Object Oriented Programming
Example
Do I make more sense?Code: Select all
TYPE Album name AS STRING caption AS STRING FUNCTION set_data(n$, c$) END TYPE FUNCTION set_data(n$, c$) ' "this" is used because the function this->name = n$ ' is specific to the variable declared this->caption = c$ ' as type Album. END FUNCTION so.. DIM MyAlbum AS Album MyAlbum.set_data("my name", "my caption") or MyAlbum->set_data("my name", "my caption")