FreeBASIC

The forum for all of your Freebasic needs!

Moderators: Pete, Mods

Post Reply
Exodus
Newbie
Posts: 6
Joined: Fri Jun 17, 2005 2:06 pm
Location: Ann Arbor, MI
Contact:

FreeBASIC

Post by Exodus » Sat Jun 18, 2005 12:10 am

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

User avatar
lurah-
Veteran
Posts: 206
Joined: Mon Nov 01, 2004 10:47 am
Location: Finland
Contact:

Post by lurah- » Sat Jun 18, 2005 12:15 am

Yes it does.

Type
Sub
Functions

User avatar
Levi
Veteran
Posts: 79
Joined: Tue Jul 27, 2004 11:44 pm
Location: Alone and forgotten
Contact:

Post by Levi » Sat Jun 18, 2005 1:04 am

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.
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

Exodus
Newbie
Posts: 6
Joined: Fri Jun 17, 2005 2:06 pm
Location: Ann Arbor, MI
Contact:

Perhaps I wasn't clear enough

Post by Exodus » Sat Jun 18, 2005 1:16 am

I ment functions and sub that are specific to a custom TYPE variable...Object Oriented Programming

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")
Do I make more sense?

Exodus
Newbie
Posts: 6
Joined: Fri Jun 17, 2005 2:06 pm
Location: Ann Arbor, MI
Contact:

Post by Exodus » Sat Jun 18, 2005 1:31 am

Thanks Levi. You answered my question as I was clearifying my question.
Levi wrote:Rather dealing with Classes, Virtual Functions, and PolyMorphism. That's what makes Object Oriented Programming, OOP.
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.

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.

Guest

Re: Perhaps I wasn't clear enough

Post by Guest » Sun Jun 19, 2005 1:49 am

Exodus wrote:I ment functions and sub that are specific to a custom TYPE variable...Object Oriented Programming

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")
Do I make more sense?
Can be emulated using Funk pointers.

User avatar
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt » Mon Jun 20, 2005 7:40 pm

Arg, you nerd! :D It's func pointer, not funk pointer! :lol:

funky

Post by funky » Tue Jun 21, 2005 1:18 am

Nekrophidius wrote:Arg, you nerd! :D It's func pointer, not funk pointer! :lol:
Shoo away!! "Funk" is Funkier.

Post Reply